Bird
0
0

You want to allow a specific AWS account to read objects but deny all others. Which bucket policy snippet achieves this?

hard📝 Application Q8 of 15
AWS - S3 Fundamentals
You want to allow a specific AWS account to read objects but deny all others. Which bucket policy snippet achieves this?
A{ "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::mybucket/*" }
B{ "Effect": "Allow", "Principal": {"AWS": "arn:aws:iam::111122223333:root"}, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::mybucket/*" }
C{ "Effect": "Deny", "Principal": {"AWS": "arn:aws:iam::111122223333:root"}, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::mybucket/*" }
D{ "Effect": "Allow", "Principal": {"AWS": "arn:aws:iam::444455556666:root"}, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::mybucket/*" }
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct Principal

    Allow only the specific AWS account with ARN ending 111122223333.
  2. Step 2: Confirm Action and Resource

    Action is GetObject on all objects in the bucket, Resource includes /*.
  3. Final Answer:

    Allow specific AWS account read access -> Option B
  4. Quick Check:

    Allow specific AWS account = B [OK]
Quick Trick: Use Principal with specific AWS account ARN to restrict access [OK]
Common Mistakes:
  • Using Principal "*" for all users
  • Denying the correct account
  • Allowing wrong account ARN

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes