-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stable UNIX users: functionality #51200
base: espadolini/stable-unix-user-api
Are you sure you want to change the base?
Stable UNIX users: functionality #51200
Conversation
@@ -233,8 +248,21 @@ func (s *server) obtainUIDForUsernameUncached(ctx context.Context, username stri | |||
return 0, trace.Wrap(err) | |||
} | |||
|
|||
// TODO(espadolini): emit an audit log event with the username and UID | |||
// that was just created | |||
if s.emitter != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the emitter be required to be non-nil in the New
?
log.DebugContext(ctx, "Host user does not exist and no UID is configured, obtaining fallback UID") | ||
fallbackUID, ok, err := obtainFallbackUID(ctx, identityContext.Login) | ||
if err != nil { | ||
log.ErrorContext(ctx, "Failed to obtain fallback (stable) UID from control plane", "error", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we refer to these as fallback, stable or configured uid? Are they really a fallback or are they primary UID if I've enabled stable_unix_user_config
in my auth preference?
This PR adds the use of fallback UIDs for host user creation in the Teleport SSHd and a
tctl
subcommand (tctl stable-unix-users ls
) to list the persisted usernames and their UIDs. This PR also adds an audit log event to the API, emitted when a new username is written.Related RFD: #50414
Part of #50292