-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add second_factors
#47233
Add second_factors
#47233
Conversation
3e32b81
to
d536667
Compare
cd71433
to
10c8b33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the separate PR, Brian! Apologies for the delay.
api/types/authentication.go
Outdated
default: | ||
slog.WarnContext(context.Background(), "Found unknown second_factor setting", "second_factor", sf) | ||
return "" // Unsure, say nothing. | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this error instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should just validate SecondFactor
in CheckAndSetDefaults
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would erroring here make for a clearer error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a170f2f
to
653babe
Compare
a543532
to
06ce4f1
Compare
🤖 Vercel preview here: https://docs-4jw07zxys-goteleport.vercel.app/docs/ver/preview |
api/types/authentication.go
Outdated
@@ -771,6 +775,16 @@ func (c *AuthPreferenceV2) CheckAndSetDefaults() error { | |||
return trace.BadParameter("missing required Webauthn configuration for headless=true") | |||
} | |||
|
|||
// Prevent accidental local lockout by disabling local second factor methods, (likely leaving only sso enabled). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we get test coverage for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…t when SSO is the only enabled MFA method; Ensure SecondFactors=[] is disallowed.
4f4e9dd
to
5e2c711
Compare
🤖 Vercel preview here: https://docs-6xrjugnkq-goteleport.vercel.app/docs/ver/preview |
* Add proto. * Add decoding logic for SecondFactorType. * Update auth preference methods to use and prefer SecondFactors. * Add fileconf and warning logs. * Fix tests. * Address comments. * Address comments. * Validate SecondFactor; Disallow SecondFactor and SecondFactors to both be set. * Address comments. * Treat second factor SSO as SecondFactor=on; Prevent local user lockout when SSO is the only enabled MFA method; Ensure SecondFactors=[] is disallowed. * Upate terraform schema, docs, crds. * Address comments. * Address comments. * Fix lint, fix test.
* Add proto. * Add decoding logic for SecondFactorType. * Update auth preference methods to use and prefer SecondFactors. * Add fileconf and warning logs. * Fix tests. * Address comments. * Address comments. * Validate SecondFactor; Disallow SecondFactor and SecondFactors to both be set. * Address comments. * Treat second factor SSO as SecondFactor=on; Prevent local user lockout when SSO is the only enabled MFA method; Ensure SecondFactors=[] is disallowed. * Upate terraform schema, docs, crds. * Address comments. * Address comments. * Fix lint, fix test.
@Joerger did we ever got docs updates for this one? |
No not yet, it's on my TODO list, along with SSO MFA docs |
Add
second_factors
and prefer it oversecond_factor
.We don't currently plan on removing second_factor, as this would require a more complicated migration process. Instead we will just derive
second_factors
fromsecond_factor
(and vice versa) and output a warning log whensecond_factor
is set.There is no plan to deprecate
second_factor
completely. Whensecond_factor
is set andsecond_factors
is not, or vice versa, we convert from one to the other.In a follow up PR I will update as much logic as possible to use
second_factors
instead ofsecond_factor
, as they are two sources of the same information.In this PR I've also added the SSO second_factor type. It is currently completely unused, but we'd rather get the proto changes into v17 rather than waiting until SSO MFA is fully released in a minor version.
Follow up TODO: Update docs.
Changelog: Add new second_factors field to cluster auth preference for more clarity and granularity over which 2fa methods are enabled in a cluster.
Depends on #47230