A company attaches a policy to every IAM user that denies all actions when aws:MultiFactorAuthPresent is false (BoolIfExists). Existing users with devices work normally, but newly created users who sign in to the console with only a password cannot register their first MFA device, because the enrollment calls are denied too. Which change lets them enroll while leaving MFA required for everything else?
Choose one.
An MFA-enforcement deny must exempt the self-service actions a user needs to enroll a device; this is done inside the deny statement with NotAction, because an explicit deny cannot be overridden by an allow.
The enrollment calls fail because the deny matches them. The fix is to stop the deny from covering them: NotAction lists the MFA self-service actions (such as iam:CreateVirtualMFADevice, iam:EnableMFADevice, iam:ResyncMFADevice, iam:ListMFADevices) and iam:GetUser, and the deny applies to everything else. A separate Allow loses to the explicit deny. Switching to Bool does not help console users, whose sessions carry the key with the value false. Moving the deny into a permissions boundary keeps it a deny.
- Recognize that the enrollment calls are blocked by an explicit deny.
- Recall that an explicit deny beats every allow, so adding an Allow cannot help.
- Exclude the enrollment actions from the deny itself with NotAction.
- Keep BoolIfExists so long-term access-key requests stay denied.
Exam tip: To let users bootstrap MFA, carve the enrollment actions out of the deny with NotAction; never try to override a deny with an allow.
AWS Authentication Strategies: MFA, STS, and Federation — the lesson that teaches this.