Skip to content

[v12] Improve performance of MFA ceremony#24804

Merged
rosstimothy merged 1 commit intobranch/v12from
tross/backport-24250/v12
Apr 25, 2023
Merged

[v12] Improve performance of MFA ceremony#24804
rosstimothy merged 1 commit intobranch/v12from
tross/backport-24250/v12

Conversation

@rosstimothy
Copy link
Copy Markdown
Contributor

Backports #24250 to branch/v12

@rosstimothy rosstimothy force-pushed the tross/backport-24250/v12 branch 2 times, most recently from 84ebd69 to d6b5f43 Compare April 19, 2023 20:37
@rosstimothy rosstimothy marked this pull request as ready for review April 19, 2023 23:15
@github-actions github-actions Bot added size/md tsh tsh - Teleport's command line tool for logging into nodes running Teleport. labels Apr 19, 2023
@rosstimothy rosstimothy force-pushed the tross/backport-24250/v12 branch from d6b5f43 to 76ce5bb Compare April 20, 2023 13:02
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from ryanclark April 20, 2023 13:55
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.
@rosstimothy rosstimothy force-pushed the tross/backport-24250/v12 branch from 76ce5bb to efc9ecb Compare April 25, 2023 18:29
@rosstimothy rosstimothy added this pull request to the merge queue Apr 25, 2023
Merged via the queue into branch/v12 with commit 81e50a1 Apr 25, 2023
@rosstimothy rosstimothy deleted the tross/backport-24250/v12 branch April 25, 2023 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport size/md tsh tsh - Teleport's command line tool for logging into nodes running Teleport.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants