我想创建一个拥有AdministratorAccess
并管理所有内容的用户,例如拒绝在IAM中删除和更新操作
我试图这样做
但是
AdministratorAccess
有没有办法做到这一点,而不试图创建复杂的多个策略?
这是我创建的政策
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "StmtXXXX",
"Effect": "Deny",
"Action": [
"iam:ChangePassword",
"iam:DeactivateMFADevice",
"iam:DeleteAccessKey",
"iam:DeleteAccountAlias",
"iam:DeleteAccountPasswordPolicy",
"iam:DeleteGroup",
"iam:DeleteGroupPolicy",
"iam:DeleteInstanceProfile",
"iam:DeleteLoginProfile",
"iam:DeleteOpenIDConnectProvider",
"iam:DeletePolicy",
"iam:DeletePolicyVersion",
"iam:DeleteRole",
"iam:DeleteRolePolicy",
"iam:DeleteSAMLProvider",
"iam:DeleteSSHPublicKey",
"iam:DeleteServerCertificate",
"iam:DeleteSigningCertificate",
"iam:DeleteUser",
"iam:DeleteUserPolicy",
"iam:DeleteVirtualMFADevice",
"iam:RemoveClientIDFromOpenIDConnectProvider",
"iam:RemoveRoleFromInstanceProfile",
"iam:RemoveUserFromGroup",
"iam:UpdateAccessKey",
"iam:UpdateLoginProfile",
"iam:UpdateSSHPublicKey"
],
"Resource": [
"arn:aws:iam::1234:user/dummyadmin"
]
}
]
}
将资源设置为arn:aws:iam::1234
后,它就有效了!
答案 0 :(得分:2)
可能更容易的选择是为除IAM之外的所有内容分配权限。这可以通过以下政策实现:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"NotAction": "iam:*",
"Resource": "*"
}
]
}
请注意使用NotAction
排除IAM。
它与您的政策(可以使用CreateUser
)不完全相同,但却是一种非常有效的方式来授予某人高级用户权限,而无法使用IAM。
答案 1 :(得分:0)
Chance资源
arn:aws:iam::1234