IAM policy example: let users manage their own MFA device, with a least privilege rewrite
Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.
Allows an IAM user to create, enable, resync and delete a virtual MFA device and to list their own MFA devices, scoped to their own user name with the aws:username variable. It follows the AWS documentation example for self-managed MFA. The original uses a wildcard on every user.
Open the workbench ยท All examples
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ManageMfa",
"Effect": "Allow",
"Action": [
"iam:*MFADevice",
"iam:ListMFADevices",
"iam:ListVirtualMFADevices"
],
"Resource": "*"
}
]
}
What it allows
- Allows creating, enabling, deactivating, deleting and resyncing MFA devices for every user in the account.
What it allows
Allow 10 actions (iam:*MFADevice, iam:ListMFADevices, iam:ListVirtualMFADevices) on every resource.
Action or pattern Actions Access levels iam:*MFADevice8 Read 1, Write 5, Tagging 2 iam:ListMFADevices1 List 1 iam:ListVirtualMFADevices1 List 1
Checks
- Medium Allows 5 write or permissions-management actions on every resource ("Resource": "*"). AWS documentation for this check
The wildcard iam:*MFADevice covers 8 actions and the resource is every user, so one user can remove another user's MFA.
Least privilege rewrite
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListOwnMfa",
"Effect": "Allow",
"Action": [
"iam:ListMFADevices",
"iam:ListVirtualMFADevices"
],
"Resource": "*"
},
{
"Sid": "ManageOwnMfa",
"Effect": "Allow",
"Action": [
"iam:CreateVirtualMFADevice",
"iam:EnableMFADevice",
"iam:ResyncMFADevice",
"iam:DeactivateMFADevice",
"iam:DeleteVirtualMFADevice"
],
"Resource": [
"arn:aws:iam::111122223333:mfa/${aws:username}",
"arn:aws:iam::111122223333:user/${aws:username}"
]
}
]
}
The rewrite names five actions and scopes them to the caller's own user and MFA device ARN. Other users' devices cannot be changed.
What it allows
Allow 2 actions (iam:ListMFADevices, iam:ListVirtualMFADevices) on every resource.
Action or pattern Actions Access levels iam:ListMFADevices1 List 1 iam:ListVirtualMFADevices1 List 1 Allow 5 actions (iam:CreateVirtualMFADevice, iam:EnableMFADevice, iam:ResyncMFADevice, iam:DeactivateMFADevice, iam:DeleteVirtualMFADevice) on arn:aws:iam::111122223333:mfa/${aws:username}, arn:aws:iam::111122223333:user/${aws:username}.
Action or pattern Actions Access levels iam:CreateVirtualMFADevice1 Write 1 iam:EnableMFADevice1 Write 1 iam:ResyncMFADevice1 Write 1 iam:DeactivateMFADevice1 Write 1 iam:DeleteVirtualMFADevice1 Write 1
Checks
No flags from the six checks.
Related pages
Sources
- IAM User Guide: self-manage an MFA device, read 16 Nov 2026
- IAM User Guide: require MFA for API access, read 16 Nov 2026
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026
Last reviewed 16 Nov 2026.