SAA-C03 Practice Question 21: CloudFront Private S3 Origin
AWS Certified Solutions Architect – Associate (SAA-C03) · Test 3 · question 1 of 10
A marketing team serves images and scripts for its website from an S3 bucket through an Amazon CloudFront distribution. The bucket has S3 Block Public Access turned on, and every object is encrypted with SSE-KMS using a customer managed key.
Security requires that viewers can fetch the objects only through CloudFront and never directly from Amazon S3 URLs. Which configuration should the architect use?
Show answer and explanation
Answer:
Origin access control (OAC) is the recommended way to lock an S3 origin down to CloudFront. CloudFront signs every request it sends to the bucket. The bucket policy allows the cloudfront.amazonaws.com service principal, with an AWS:SourceArn condition naming this one distribution, so the bucket stays private and a direct S3 request from a viewer is denied. Because the objects use SSE-KMS, the KMS key policy must also let the same principal decrypt. AWS documents that OAC supports SSE-KMS.
Option A breaks both requirements. A website endpoint can only be a custom origin, so OAC and OAI cannot be used with it. The bucket would have to be public, which Block Public Access prevents, and anyone could fetch objects straight from the website endpoint.
Option C is the legacy mechanism. AWS lists SSE-KMS among the features that origin access identity doesn't support, so the encrypted objects would not be served without workarounds. AWS recommends migrating from OAI to OAC.
Option D is not a real access control. The Referer header is set by the client and is trivial to forge, so the objects are effectively public. It also needs a public bucket policy, which Block Public Access rejects.
Reference: Restrict access to an Amazon S3 origin