-
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
Allow setting additional traits in tctl users add command #12102
Conversation
@@ -116,6 +116,7 @@ func NewPresetAccessRole() types.Role { | |||
role.SetWindowsLogins(types.Allow, []string{teleport.TraitInternalWindowsLoginsVariable}) | |||
role.SetKubeUsers(types.Allow, []string{teleport.TraitInternalKubeUsersVariable}) | |||
role.SetKubeGroups(types.Allow, []string{teleport.TraitInternalKubeGroupsVariable}) | |||
role.SetAWSRoleARNs(types.Allow, []string{teleport.TraitInternalAWSRoleARNs}) |
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.
Wonder is we should bother about migration to cover the case where an access role was already created without aws role arn trait placeholder but a user follows the doc and tries to leverage aws-role-arns
tctl flag.
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.
We generally don't migrate existing roles (even presets) because users may have their own roles with the same names and we don't want to modify them.
This PR updates
tctl users add
command to support providing additional internal user traits which can then be used in role templating.It already had flags for
logins
andwindows_logins
, this PR also adds support forkubernetes_users
,kubernetes_groups
,database_users
,database_names
andaws_role_arns
, and their respective{{internal.xxx}}
role template variables.With this change admins would be able to create local users and set all traits in a single command without having to edit the user after the fact, e.g.
$ tctl users add --roles=access,editor \ --logins=root \ --database-users=postgres,test \ --database-names=\* \ --kubernetes-groups=system:masters \ alice
This will significantly simplify parts of database access getting started guides which currently ask to create the Teleport user and then update the resource to set the traits (I'll update the docs after this merges).
Closes #10529.