试图限制对SecretsManager机密的访问,而我试图将此策略附加到资源上;
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": "secretsmanager:*",
"Resource": "arn:aws:secretsmanager:us-east-2:<account-id>:secret:1-Cc7SuZ",
"NotPrincipal": {"AWS": [
"arn:aws:iam::<account-id>:user/test-user2",
"arn:aws:iam::<account-id>:user/test-admin"
]}
},
]
}
并引发此错误;
An error occurred (AccessDeniedException) when calling the PutResourcePolicy operation: User:
arn:aws:iam::<account-id>:user/test-admin is not authorized to perform:
secretsmanager:PutResourcePolicy on resource: arn:aws:secretsmanager:us-east-2:<account-
id>:secret:1-Cc7SuZ with an explicit deny
更多背景信息;
Principal
而不是NotPrincipal
上很好,所以我不知道这怎么可能是权限问题。顺便说一句,是否有另一种方法可以解决此问题而不必撤销先前授予的许可?