[v11] Improve performance of MFA ceremony#24829
Merged
rosstimothy merged 1 commit intobranch/v11from Apr 25, 2023
Merged
Conversation
ad67e37 to
f7b5d7b
Compare
Joerger
approved these changes
Apr 19, 2023
zmb3
approved these changes
Apr 20, 2023
f7b5d7b to
6ca378f
Compare
To date clients attempting to access a resource first have to call `proto.AuthService/IsMFARequired` to determine if an mfa ceremony is needed for access to a resource. In an effort to reduce an extra round trip to the Auth server this can can be bundled into `proto.AuthService/GenerateUserSingleUseCerts`. In order for RBAC to determine if mfa is required for SSH sessions the OS login of the session must be known. To accomodate this a new `SSHLogin` field was added to `proto.UserCertsRequest`. The response to the initial request of the stream now contains a `proto.MFARequired` enum which indicates whether mfa is required, not required, or it's unknown if mfa is required. The last variant should only be returned when the `SSHLogin` field is unset in the initial request. The `(auth.Server) isMFARequired` check was also modified for nodes to make use of `ListResources`. Instead of retrieving **all** nodes into memory and finding the matching ones, a request is made to `ListResources` with the `SearchKeywords` populated with the target from `proto.IsMFARequiredRequest_Node.Node.Node`. Care was taken to filter out any matches from labels to preserve the original matching behavior.
6ca378f to
ac19b6f
Compare
rosstimothy
added a commit
that referenced
this pull request
May 4, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backports #24250 to branch/v11