Skip to content

Instantly share code, notes, and snippets.

@zeridon
Created December 19, 2014 12:28
Show Gist options
  • Save zeridon/f50eda1aaa16dd0d96ca to your computer and use it in GitHub Desktop.
Save zeridon/f50eda1aaa16dd0d96ca to your computer and use it in GitHub Desktop.
IAM Policy to manage own credentials including MFA
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowUsersAllActionsForCredentials",
"Effect": "Allow",
"Action": [
"iam:ChangePassword",
"iam:*LoginProfile",
"iam:*SigningCertificate*",
"iam:*AccessKey*"
],
"Resource": ["arn:aws:iam::<aws-account-id>:user/${aws:username}"]
},
{
"Sid": "AllowUsersToSeeStatsOnIAMConsoleDashboard",
"Effect": "Allow",
"Action": [
"iam:GetAccount*",
"iam:ListAccount*"
],
"Resource": ["*"]
},
{
"Sid": "AllowUsersToCreateDeleteTheirOwnMFADevices",
"Effect": "Allow",
"Action": [
"iam:*VirtualMFADevice*",
"iam:*MFADevice*"
],
"Resource": [
"arn:aws:iam::<aws-account-id>:user/${aws:username}",
"arn:aws:iam::<aws-account-id>:mfa/${aws:username}"
]
},
{
"Sid": "AllowUsersToListVirtualMFADevices",
"Effect": "Allow",
"Action": ["iam:ListVirtualMFADevices", "iam:ListMFADevices" ],
"Resource": ["arn:aws:iam::<aws-account-id>:mfa/*"]
},
{
"Sid": "AllowUsersToListUsersInConsole",
"Effect": "Allow",
"Action": ["iam:ListUsers"],
"Resource": ["arn:aws:iam::<aws-account-id>:user/*"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment