Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
RFD: Add Automatic User Provisioning #11077
RFD: Add Automatic User Provisioning #11077
Changes from all commits
4d8eecc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Worth mentioning that
useradd
, compared toadduser
, does not provision home directory. I think it should be fine for dynamic users. Any there any other differences between these 2 commands?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.
adduser
is distro specific so its sometimes not available or has different command sets available.useradd
can create home directories, i think it just doesnt by default, its flag is--create-home
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.
Would agent recycle users that are inactive automatically? Same for sudoers lines
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.
What do you mean by recycle inactive users?
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.
After sessions end the user and their sudoers files are deleted, if they're leftover (due to, for example a running process remaining) they and their sudoers file will be removed also.
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.
Can we make this configurable and start with this. This doesn't have
@
,_
which are pretty common. Also GCP will create users with their personalized emails.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.
I'm dont know how to make this configurable or what the ux should be like for such a thing, I intended to replace any characters that dont fit with
-
.I was operating under the impression that the users unix username would need to match the teleport user however I think it would make sense that it be any user available in the logins trait, in which case it could be up to the user to provide an external trait -- something like
{{external.linix_username}}
, which conforms to the requirements of whatever Linux distro is being used and have Teleport try to blindly create users and just log an error when it failsThere 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.
How do we deal with leftover files? Are we ok with the UID being reused by some other user (real or ephemeral) in the future?
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.
As it stands I expected UIDs to be reused, but perhaps it could make sense to have user deletion set the shell to /bin/nologin or something, this way UIDs wont clash
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.
Props for UX examples, makes it much easier to understand
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.
Is this field an array of entries for the sudoers file? Just want to make sure
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.
yeah, each entry will be a new line
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.
This seems overly cautious - this means that all roles assigned to a user must have this on. What is the rationale for that?
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.
@r0mant suggested this, I assumed it was to avoid the possibility that a user accidentally receives too much access
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.
I think the idea was to have all roles that match the node you're SSH'ing into require "create_host_user: true", right?
In the example below, both roles match nodes with label
env: example
so most strict setting takes advantage and automatic user creation is basically disabled when you're SSH'ing into such a node.If, however, your second role did not match
env: example
nodes, then the first role's setting would kick in when you're SSH'ing intoenv: example
nodes so auto creation is enabled.@lxea @klizhentas Does that behavior sound ok?
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.
ok, but it could be confusing to some customers, please make it very clear in the docs