Fix agent not enforcing MFA device lock after in-band MFA. - #69653
Draft
cthach wants to merge 1 commit into
Draft
Conversation
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Signed-off-by: Chris Thach <chris.thach@goteleport.com>
cthach
force-pushed
the
cthach/enforce-in-band-lock
branch
from
August 13, 2026 23:39
c82aa74 to
882ae35
Compare
Contributor
Author
|
TODO: Migrate this PR to our new repo. Will open it for review then. |
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.
Part 2 of bug fix for https://github.com/gravitational/core/issues/146.
After successful in-band MFA during SSH session establishment, the Agent will append the MFA device used to satisfy the MFA challenge as a lock target to decisionpb.SSHAccessPermit.LockTargets.
This works because lock enforcement happens further downstream in AcquireSessionContext and NewServerContext; the former being lock enforcement for new connections and latter for established connections.
Alternatives considered
MFADeviceon the IdentityContext. Rejected because it was has broader implications and because it conflicts withIdentityContext.UnmappedIdentity.MFAVerified.Future work
TestSSHOnMultipleNodes. Current coverage added in this PR should suffice, but adding integration coverage will give us confidence the whole system is working E2E, especially the trusted cluster scenario. It should be a matter of creating a lock, waiting for the lock to propagate, attempting to connect and asserting on the error.Manual Test Plan
Test Environment
Teleport instance built with
make full-entrunning on my Mac. My clients are built from Teleport v18.Test Cases