Last active
March 27, 2025 11:15
-
-
Save o6uoq/8b9f3f3f80b7e8857dbc8bec03e4c653 to your computer and use it in GitHub Desktop.
AWS: EnforceMFAOnLogin
This file contains 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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowLoginPasswordResetAndMFASetup", | |
"Effect": "Allow", | |
"Action": [ | |
"iam:GetUser", | |
"iam:GetLoginProfile", | |
"iam:ChangePassword", | |
"iam:CreateVirtualMFADevice", | |
"iam:EnableMFADevice", | |
"iam:ListMFADevices", | |
"iam:ListVirtualMFADevices", | |
"iam:ResyncMFADevice", | |
"iam:DeleteVirtualMFADevice" | |
], | |
"Resource": "arn:aws:iam::*:user/${aws:username}" | |
}, | |
{ | |
"Sid": "DenyAllExceptMFASetupIfNotUsingMFA", | |
"Effect": "Deny", | |
"NotAction": [ | |
"iam:GetUser", | |
"iam:GetLoginProfile", | |
"iam:ChangePassword", | |
"iam:CreateVirtualMFADevice", | |
"iam:EnableMFADevice", | |
"iam:ListMFADevices", | |
"iam:ListVirtualMFADevices", | |
"iam:ResyncMFADevice", | |
"iam:DeleteVirtualMFADevice" | |
], | |
"Resource": "*", | |
"Condition": { | |
"Bool": { | |
"aws:MultiFactorAuthPresent": "false" | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment