Last active
October 12, 2024 03:57
-
-
Save ifduyue/162c7ad9b0e17177bf97844d25c170cc to your computer and use it in GitHub Desktop.
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": "AllowViewAccountInfo", | |
"Effect": "Allow", | |
"Action": [ | |
"iam:GetAccountPasswordPolicy", | |
"iam:ListVirtualMFADevices" | |
], | |
"Resource": "*" | |
}, | |
{ | |
"Sid": "AllowManageOwnPasswords", | |
"Effect": "Allow", | |
"Action": [ | |
"iam:ChangePassword", | |
"iam:GetUser", | |
"iam:GetLoginProfile", | |
"iam:UpdateLoginProfile" | |
], | |
"Resource": "arn:aws:iam::*:user/${aws:username}" | |
}, | |
{ | |
"Sid": "AllowManageOwnAccessKeys", | |
"Effect": "Allow", | |
"Action": [ | |
"iam:CreateAccessKey", | |
"iam:DeleteAccessKey", | |
"iam:ListAccessKeys", | |
"iam:UpdateAccessKey", | |
"iam:GetAccessKeyLastUsed" | |
], | |
"Resource": "arn:aws:iam::*:user/${aws:username}" | |
}, | |
{ | |
"Sid": "AllowManageOwnSigningCertificates", | |
"Effect": "Allow", | |
"Action": [ | |
"iam:DeleteSigningCertificate", | |
"iam:ListSigningCertificates", | |
"iam:UpdateSigningCertificate", | |
"iam:UploadSigningCertificate" | |
], | |
"Resource": "arn:aws:iam::*:user/${aws:username}" | |
}, | |
{ | |
"Sid": "AllowManageOwnSSHPublicKeys", | |
"Effect": "Allow", | |
"Action": [ | |
"iam:DeleteSSHPublicKey", | |
"iam:GetSSHPublicKey", | |
"iam:ListSSHPublicKeys", | |
"iam:UpdateSSHPublicKey", | |
"iam:UploadSSHPublicKey" | |
], | |
"Resource": "arn:aws:iam::*:user/${aws:username}" | |
}, | |
{ | |
"Sid": "AllowManageOwnGitCredentials", | |
"Effect": "Allow", | |
"Action": [ | |
"iam:CreateServiceSpecificCredential", | |
"iam:DeleteServiceSpecificCredential", | |
"iam:ListServiceSpecificCredentials", | |
"iam:ResetServiceSpecificCredential", | |
"iam:UpdateServiceSpecificCredential" | |
], | |
"Resource": "arn:aws:iam::*:user/${aws:username}" | |
}, | |
{ | |
"Sid": "AllowManageOwnVirtualMFADevice", | |
"Effect": "Allow", | |
"Action": [ | |
"iam:CreateVirtualMFADevice" | |
], | |
"Resource": "arn:aws:iam::*:mfa/*" | |
}, | |
{ | |
"Sid": "AllowManageOwnUserMFA", | |
"Effect": "Allow", | |
"Action": [ | |
"iam:DeactivateMFADevice", | |
"iam:EnableMFADevice", | |
"iam:ListMFADevices", | |
"iam:ResyncMFADevice" | |
], | |
"Resource": "arn:aws:iam::*:user/${aws:username}" | |
}, | |
{ | |
"Sid": "DenyAllExceptListedIfNoMFA", | |
"Effect": "Deny", | |
"NotAction": [ | |
"iam:CreateVirtualMFADevice", | |
"iam:EnableMFADevice", | |
"iam:GetUser", | |
"iam:UpdateLoginProfile", | |
"iam:ChangePassword", | |
"iam:GetAccountPasswordPolicy", | |
"iam:GetMFADevice", | |
"iam:ListMFADevices", | |
"iam:ListVirtualMFADevices", | |
"iam:ResyncMFADevice", | |
"sts:GetSessionToken" | |
], | |
"Resource": "*", | |
"Condition": { | |
"BoolIfExists": { | |
"aws:MultiFactorAuthPresent": "false" | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment