Security

An application's IAM role must list object keys in one S3 bucket but must not read object contents. Which permission should its identity-based policy allow?

Show the answer

Correct answerC. s3:ListBucket on the bucket ARN

AWhy not this: ListBucket requires a bucket resource; object ARNs do not match its resource type.

BWhy not this: GetObject reads object contents and requires an object resource, not the bucket ARN.

CWhy this is right: ListBucket permits listing object keys and uses the bucket ARN as its resource.

DWhy not this: GetObject on object ARNs permits reading contents rather than listing keys.

s3:ListBucket authorizes listing object keys and applies to the bucket ARN. s3:GetObject authorizes reading object contents and applies to object ARNs, so it does not meet the requirement.