Skip to content

Commit

Permalink
Improve validation error message regarding 2FA (#15350)
Browse files Browse the repository at this point in the history
We really need to make sure admin doesn't lock himself out when
enabling GPOS STIG compatibility.
  • Loading branch information
anodos325 authored Jan 9, 2025
1 parent f5677a8 commit ee3fe49
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/middlewared/middlewared/plugins/security/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ async def validate_stig(self, current_cred):
)

if current_cred and current_cred.is_user_session and '2FA' not in current_cred.user['account_attributes']:
# We need to do everything we can to make sure that 2FA is _actually_ working for
# an account to which admin has access.
raise ValidationError(
'system_security_update.enable_gpos_stig',
'Credential used to enable General Purpose OS STIG compatibility '
'must have two factor authentication enabled.'
'must have two factor authentication enabled, and have used two factor '
'authentication for the currently-authenticated session.'
)

@private
Expand Down

0 comments on commit ee3fe49

Please sign in to comment.