Skip to content

Remove expirations for managed users#47774

Merged
eriktate merged 1 commit intomasterfrom
eriktate/host-user-password-expiration
Oct 30, 2024
Merged

Remove expirations for managed users#47774
eriktate merged 1 commit intomasterfrom
eriktate/host-user-password-expiration

Conversation

@eriktate
Copy link
Copy Markdown
Contributor

@eriktate eriktate commented Oct 21, 2024

This PR attempts to remove any password or account expirations from host users managed by Teleport. This will happen during new user creation and when resolving updates against existing managed users. It will not remove expirations from unmanaged users (test coverage for this coming soon). These changes are meant to prevent password expiration warnings, and eventual account disabling, caused by local password policies on some hosts.

changelog: Updated host user creation to prevent local password expiration policies from affecting Teleport managed users.

Comment thread integration/hostuser_test.go
Comment thread lib/utils/host/hostusers.go
Comment thread lib/utils/host/hostusers.go Outdated
Comment thread lib/utils/host/hostusers.go
return users, -1, nil
}

func UserHasExpirations(username string) (bool bool, exitCode int, err error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like this is following the pattern of other functions in this file of returning an exit code when shelling out to an external binary. However, I wonder if that makes sense from an API perspective. These functions don't expose to users which binaries were being invoked, and are instead meant to abstract away the fact that some other binary is being used. By returning the exit code, we leak that information to callers, without giving them much insight into what the values of the exit codes might mean.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah I agree that the exit codes aren't especially useful for any of these functions. I'll submit a separate PR updating utils/host/hostusers.go that removes exit codes from the return types

Comment thread lib/utils/host/hostusers.go Outdated
Comment thread lib/utils/host/hostusers.go Outdated
@aws-amplify-us-west-2
Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-47774.d3pp5qlev8mo18.amplifyapp.com

Comment thread integration/hostuser_test.go Outdated
Comment thread lib/srv/usermgmt.go Outdated
Comment thread lib/utils/host/hostusers.go Outdated
Comment thread lib/utils/host/hostusers.go Outdated
Comment thread lib/utils/host/hostusers.go Outdated
Comment thread lib/srv/usermgmt.go Outdated
@eriktate eriktate force-pushed the eriktate/host-user-password-expiration branch from 8f1db91 to 47df5bb Compare October 25, 2024 19:57
@eriktate
Copy link
Copy Markdown
Contributor Author

@Joerger @strideynet friendly bump 😄

@eriktate
Copy link
Copy Markdown
Contributor Author

@Joerger @strideynet Sending another nudge

Comment thread lib/utils/host/hostusers.go
Comment thread lib/utils/host/hostusers.go Outdated
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from Joerger October 30, 2024 13:17
…s or password locks for managed teleport users
@eriktate eriktate force-pushed the eriktate/host-user-password-expiration branch from 47df5bb to d435e8a Compare October 30, 2024 14:43
@eriktate eriktate added this pull request to the merge queue Oct 30, 2024
Merged via the queue into master with commit 489bebd Oct 30, 2024
@eriktate eriktate deleted the eriktate/host-user-password-expiration branch October 30, 2024 15:23
@public-teleport-github-review-bot
Copy link
Copy Markdown

@eriktate See the table below for backport results.

Branch Result
branch/v14 Failed
branch/v15 Failed
branch/v16 Failed
branch/v17 Create PR

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants