Bird
0
0

What is the issue with this bucket policy snippet?

medium📝 Debug Q6 of 15
AWS - S3 Fundamentals
What is the issue with this bucket policy snippet?
{
  "Effect": "Allow",
  "Principal": "*",
  "Action": "s3:GetObject",
  "Resource": "arn:aws:s3:::mybucket"
}
AThe Resource ARN should include a wildcard (/*) to specify objects inside the bucket
BThe Principal cannot be "*" for s3:GetObject action
CThe Effect should be "Deny" to allow access
DThe Action "s3:GetObject" is invalid in bucket policies
Step-by-Step Solution
Solution:
  1. Step 1: Understand resource ARN for object actions

    Actions like s3:GetObject require specifying objects, so the ARN must end with /*.
  2. Step 2: Check the given ARN

    The ARN "arn:aws:s3:::mybucket" refers only to the bucket itself, not objects inside.
  3. Step 3: Identify the error

    Missing /* means the policy does not apply to objects, so access won't be granted.
  4. Final Answer:

    The Resource ARN should include a wildcard (/*) to specify objects inside the bucket is correct.
  5. Quick Check:

    Object actions require resource ARN with /* suffix [OK]
Quick Trick: Object actions require resource ARN with /* suffix [OK]
Common Mistakes:
  • Using bucket ARN without /* for object-level actions
  • Assuming Principal "*" is invalid for GetObject
  • Confusing Effect Allow/Deny

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes