An organization manages its AWS accounts using AWS Organizations with all features enabled. A SysOps administrator in a member account is troubleshooting why an IAM user (`arn:aws:iam::111122223333:user/LogOperator`) cannot delete objects from an Amazon S3 bucket named `prod-log-bucket`, despite the user having an identity-based IAM policy that allows `s3:DeleteObject` and `s3:DeleteObjectVersion` on the bucket.
The administrator discovers that the management account has applied the following Service Control Policy (SCP) to the member account:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "RestrictDeletions",
"Effect": "Deny",
"Action": [
"s3:DeleteObject",
"s3:DeleteObjectVersion"
],
"Resource": "arn:aws:s3:::prod-log-bucket/*",
"Condition": {
"ArnNotEquals": {
"aws:PrincipalArn": "arn:aws:iam::111122223333:role/LogCleanupRole"
}
}
}
]
}
Why is the IAM user unable to delete objects from the S3 bucket?
- The SCP contains an explicit Deny statement that applies to all principals in the member account except the specified LogCleanupRole, which overrides the IAM user's Allow permission.Cevap
- BThe IAM user has not been granted the iam:PassRole permission to assume the LogCleanupRole, which is required to bypass the SCP restriction.
- CThe S3 bucket policy in the member account must explicitly trust the management account's SCP before the exclusion rule can be applied.
- DThe IAM user is connecting from a subnet whose route table lacks a route to the S3 gateway VPC endpoint, causing the condition key to fail validation.