Bird
0
0

You want to create an IAM group that grants read-only access to objects in the S3 bucket named project-files. Which policy snippet correctly enforces this?

hard📝 Best Practice Q8 of 15
AWS - Identity and Access Management
You want to create an IAM group that grants read-only access to objects in the S3 bucket named project-files. Which policy snippet correctly enforces this?
A{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": ["s3:GetObject"], "Resource": "arn:aws:s3:::project-files/*" }] }
B{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": ["s3:ListBucket"], "Resource": "arn:aws:s3:::project-files" }] }
C{ "Version": "2012-10-17", "Statement": [{ "Effect": "Deny", "Action": ["s3:DeleteObject"], "Resource": "arn:aws:s3:::project-files/*" }] }
D{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": ["s3:*"], "Resource": "arn:aws:s3:::project-files/*" }] }
Step-by-Step Solution
Solution:
  1. Step 1: Identify required permissions

    Read-only access to objects requires s3:GetObject on bucket objects.
  2. Step 2: Analyze options

    { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": ["s3:GetObject"], "Resource": "arn:aws:s3:::project-files/*" }] } allows s3:GetObject on all objects in the bucket, which is correct.
  3. Step 3: Exclude incorrect options

    { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": ["s3:ListBucket"], "Resource": "arn:aws:s3:::project-files" }] } only allows listing the bucket, not reading objects. { "Version": "2012-10-17", "Statement": [{ "Effect": "Deny", "Action": ["s3:DeleteObject"], "Resource": "arn:aws:s3:::project-files/*" }] } denies delete but does not allow read. { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": ["s3:*"], "Resource": "arn:aws:s3:::project-files/*" }] } allows all actions, which is too permissive.
  4. Final Answer:

    Option A -> Option A
  5. Quick Check:

    Use s3:GetObject on bucket objects for read-only [OK]
Quick Trick: Use s3:GetObject on bucket ARN with /* suffix [OK]
Common Mistakes:
  • Granting s3:ListBucket only without GetObject
  • Using Deny instead of Allow for read access
  • Granting full s3:* permissions unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes