RequireMFAType#16034
Conversation
4e964db to
8f481b9
Compare
416fab4 to
33c9a31
Compare
GavinFrazar
left a comment
There was a problem hiding this comment.
LGTM, just a couple more comments but only minor things
27af113 to
a9db185
Compare
(string). - Add new RequireMFAType constant values with custom boolean marshalling. - Add RequireMFAType to role and auth preference and deprecate RequireSessionMFA. - Add session-mfa override login when hardware_key_touch is enforced. - Add protobuf enum for RequireMFAType. - Add support for proto enums in protoc-gen-crd and update Kubernetes Operator manifests.
a9db185 to
5b834f8
Compare
| expectRequired = expectRequired && (roleRequireMFAType.IsSessionMFARequired() || authPrefRequireMFAType.IsSessionMFARequired()) | ||
|
|
||
| t.Run(fmt.Sprintf("authPref=%v/role=%v/expect=%v", authPrefRequireMFAType, roleRequireMFAType, expectRequired), func(t *testing.T) { | ||
| roleOpt := role.GetOptions() |
There was a problem hiding this comment.
How much does this test take? Can we run it in parallel?
There was a problem hiding this comment.
It takes ~2.5s for me locally. Since it's changing the test server's Role and AuthPref for each subtest, it can't be run in parallel.
I tested recreating the server for each subtest in order to parallize the tests, but it results in the same ~2.5s run while using more computing resources.
|
I noticed we don't document but I don't see any point in opening a docs PR to add it right before you merge this and it will need to be changed to the enum. Just want to mention it so when you update the docs you update that reference yaml as well. How far back are you backporting this? |
Nice catch, I'll be making a docs PR once the main change set is landed in master (a couple more PRs...), I'll make sure to include this.
Most likely just v10. |
* Add hardware key settings to cluster auth preference. * Parse HardwareKey auth settings from configuration file. * Add GetRequireKnownSerialNumber method to AuthPrefence type. * Add deprecation logic for authpref.PIVSlot, following the logic set out in #16034. * Address comments.
* Add hardware key settings to cluster auth preference. * Parse HardwareKey auth settings from configuration file. * Add GetRequireKnownSerialNumber method to AuthPrefence type. * Add deprecation logic for authpref.PIVSlot, following the logic set out in #16034. * Address comments.
* Add hardware key settings to cluster auth preference. * Parse HardwareKey auth settings from configuration file. * Add GetRequireKnownSerialNumber method to AuthPrefence type. * Add deprecation logic for authpref.PIVSlot, following the logic set out in #16034. * Address comments.
* Add hardware key settings to cluster auth preference. * Parse HardwareKey auth settings from configuration file. * Add GetRequireKnownSerialNumber method to AuthPrefence type. * Add deprecation logic for authpref.PIVSlot, following the logic set out in #16034. * Address comments.
* Add hardware key settings to cluster auth preference. * Parse HardwareKey auth settings from configuration file. * Add GetRequireKnownSerialNumber method to AuthPrefence type. * Add deprecation logic for authpref.PIVSlot, following the logic set out in #16034. * Address comments.
* Add hardware key settings to cluster auth preference. * Parse HardwareKey auth settings from configuration file. * Add GetRequireKnownSerialNumber method to AuthPrefence type. * Add deprecation logic for authpref.PIVSlot, following the logic set out in #16034. * Address comments.
This PR is a prerequisite for #15874, which will actually make use of the new require mfa types.
Changes:
role.options.require_session_mfaandauth_preference.require_session_mfahave been changed from booleans to a protobuf enum type -types.RequireMFAType- with the following values.OFF: corresponds torequire_session_mfa: falseSESSION: corresponds torequire_session_mfa: trueSESSION_AND_HARDWARE_KEY: corresponds torequire_session_mfa: hardware_keyrequire_session_mfa: true. In PIV login enforcement #15874, this value will be used to require PIV login.HARDWARE_KEY_TOUCH: corresponds torequire_session_mfa: hardware_key_touchBackwards compatibility
This PR mirrors #12054 in how the type is changed in a backwards compatible way. Take a look at that PR for a thorough explanation.