AWS Certified Security – Specialty (SCS-C02) — Question 39
A company has a web server in the AWS Cloud. The company will store the content for the web server in an Amazon S3 bucket. A security engineer must use an Amazon CloudFront distribution to speed up delivery of the content. None of the files can be publicly accessible from the S3 bucket directly.
Which solution will meet these requirements?
Answer options
- A. Configure the permissions on the individual files in the S3 bucket so that only the CloudFront distribution has access to them.
- B. Create an origin access control (OAC). Associate the OAC with the CloudFront distribution. Configure the S3 bucket permissions so that only the OAC can access the files in the S3 bucket.
- C. Create an S3 role in AWS Identity and Access Management (IAM). Allow only the CloudFront distribution to assume the role to access the files in the S3 bucket.
- D. Create an S3 bucket policy that uses only the CloudFront distribution ID as the principal and the Amazon Resource Name (ARN) as the target.
Correct answer: B
Explanation
Option B is correct because it uses an origin access control (OAC) to restrict access to the S3 bucket while allowing the CloudFront distribution to access the files. Option A incorrectly suggests permissions on individual files, which does not effectively restrict access as intended. Option C introduces unnecessary complexity with IAM roles that are not needed for this scenario, and Option D is less secure as it may not enforce the necessary restrictions properly.