Skip to content

Instantly share code, notes, and snippets.

@rberger
Created August 3, 2015 05:09
Show Gist options
  • Save rberger/bba4e7656e368a6e2b43 to your computer and use it in GitHub Desktop.
Save rberger/bba4e7656e368a6e2b43 to your computer and use it in GitHub Desktop.
Additional iam policies to allow power users to update their console password and 2FA
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowUsersAllActionsForCredentials",
"Effect": "Allow",
"Action": [
"iam:*LoginProfile",
"iam:*AccessKey*",
"iam:*SigningCertificate*"
],
"Resource": [
"arn:aws:iam::<Your AWS Account ID>:user/${aws:username}"
]
},
{
"Sid": "AllowUsersToSeeStatsOnIAMConsoleDashboard",
"Effect": "Allow",
"Action": [
"iam:GetAccount*",
"iam:ListAccount*"
],
"Resource": [
"*"
]
},
{
"Sid": "AllowUsersToListUsersInConsole",
"Effect": "Allow",
"Action": [
"iam:ListUsers"
],
"Resource": [
"arn:aws:iam::<Your AWS Account ID>:user/*"
]
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowUsersToCreateDeleteTheirOwnVirtualMFADevices",
"Effect": "Allow",
"Action": [
"iam:*VirtualMFADevice"
],
"Resource": [
"arn:aws:iam::<Your AWS Account ID>:mfa/${aws:username}"
]
},
{
"Sid": "AllowUsersToEnableSyncDisableTheirOwnMFADevices",
"Effect": "Allow",
"Action": [
"iam:DeactivateMFADevice",
"iam:EnableMFADevice",
"iam:ListMFADevices",
"iam:ResyncMFADevice"
],
"Resource": [
"arn:aws:iam::<Your AWS Account ID>:user/${aws:username}"
]
},
{
"Sid": "AllowUsersToListVirtualMFADevices",
"Effect": "Allow",
"Action": [
"iam:ListVirtualMFADevices"
],
"Resource": [
"arn:aws:iam::<Your AWS Account ID>:mfa/*"
]
},
{
"Sid": "AllowUsersToListUsersInConsole",
"Effect": "Allow",
"Action": [
"iam:ListUsers"
],
"Resource": [
"arn:aws:iam::<Your AWS Account ID>:user/*"
]
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"NotAction": "iam:*",
"Resource": "*"
}
]
}
@meeuw
Copy link

meeuw commented Mar 9, 2021

🤔 AllowUsersToCreateDeleteTheirOwnVirtualMFADevices without MFA seems to me like a VERY bad idea...

This allows a hacker to remove and add their own MFA device 👋 MFA ...

@rberger
Copy link
Author

rberger commented Mar 10, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment