Last active
May 29, 2021 10:51
-
-
Save serban-petrescu/22c3bc3091a8b7c5edabc6dfe815054f to your computer and use it in GitHub Desktop.
AWS MFA Policy
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": "DenyAllExceptListedIfNoMFA", | |
"Effect": "Deny", | |
"NotAction": [ | |
"iam:ChangePassword", | |
"iam:GetAccountPasswordPolicy", | |
"iam:CreateVirtualMFADevice", | |
"iam:EnableMFADevice", | |
"iam:GetUser", | |
"iam:ListMFADevices", | |
"iam:ListVirtualMFADevices", | |
"iam:ResyncMFADevice", | |
"sts:GetSessionToken" | |
], | |
"Resource": "*", | |
"Condition": { | |
"BoolIfExists": { | |
"aws:MultiFactorAuthPresent": "false" | |
} | |
} | |
} | |
] | |
} |
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
aws sts get-session-token ^ | |
--serial-number arn:aws:iam::<account>:mfa/<user> ^ | |
--token-code <mfa token> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment