[v12] Improve performance of MFA ceremony#24804
Merged
rosstimothy merged 1 commit intobranch/v12from Apr 25, 2023
Merged
Conversation
84ebd69 to
d6b5f43
Compare
Joerger
approved these changes
Apr 19, 2023
d6b5f43 to
76ce5bb
Compare
codingllama
approved these changes
Apr 20, 2023
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.
76ce5bb to
efc9ecb
Compare
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/v12