Skip to content

feat: added controller attribution - #1890

Open
Tbaile wants to merge 1 commit into
mainfrom
user-pass-conroller
Open

Tbaile wants to merge 1 commit into
mainfrom
user-pass-conroller

Conversation

@Tbaile

@Tbaile Tbaile commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

`POST /login` now accepts an optional `on_behalf_of` field, accepted only from the controller machine account, carried in the JWT and appended to the `[AUTH]` log lines as the delegated operator.

Needs: NethServer/nethsecurity-controller#293

Closes: #1894

Description generated with Claude Code

@Tbaile
Tbaile force-pushed the user-pass-conroller branch from 6f8caad to fc206a4 Compare September 22, 2026 11:46
@Tbaile
Tbaile force-pushed the user-pass-conroller branch from fc206a4 to a0501f0 Compare September 22, 2026 11:53
@Tbaile
Tbaile requested a review from gsanchietti September 22, 2026 11:57
@Tbaile
Tbaile marked this pull request as ready for review September 22, 2026 11:57
}

// control characters would let a crafted name forge extra log lines
if strings.ContainsFunc(onBehalfOf, func(r rune) bool { return r < 0x20 || r == 0x7f }) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd move to a regexp validation since onBehakfOf is always a unix-like user: something like regexp.MustCompile(^[A-Za-z0-9._@-]+$)

}

if user.SudoRequested {
claims["sudo"] = time.Now().Unix()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it could be useful to log the sudo request?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log real admin identity for all unit actions performed via controller

2 participants