Courseiva
Question 1,184 of 247
Networking and Content DeliverymediumMultiple ChoiceObjective-mapped

SOA-C02 Networking and Content Delivery Practice Question

A company has an Amazon CloudFront distribution that delivers static content from an Amazon S3 bucket. The SysOps administrator needs to ensure that the content can only be accessed through CloudFront and not directly from the S3 bucket URL. The solution should use AWS managed services with minimal configuration. Which solution should the administrator implement?

⚠ Common exam trap

Many candidates choose Option C (AWS WAF with Referer header) because it seems like a simple web-application-layer control, but they overlook that the Referer header is easily spoofed and does not provide cryptographic authentication, unlike the OAI-based approach which uses AWS Signature Version 4 to verify the request origin.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Configure the S3 bucket policy to deny all access except from the CloudFront distribution's origin access identity (OAI).

Configuring the S3 bucket policy to deny all access except from the CloudFront distribution's origin access identity (OAI) ensures that only CloudFront can retrieve objects from the S3 bucket. The OAI is a special CloudFront user that authenticates requests to S3, and the bucket policy explicitly grants GetObject access only to that principal, blocking any direct S3 URL access. This uses AWS managed services (CloudFront and S3) with minimal configuration—no custom code or additional infrastructure.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Configure the S3 bucket policy to deny all access except from the CloudFront distribution's origin access identity (OAI).

    Why this is correct

    An Origin Access Identity (OAI) is a special CloudFront identity that can be assigned to a distribution, and the S3 bucket policy can explicitly grant read permission to that OAI's principal while using an explicit deny for all other principals. Since CloudFront signs requests as the OAI, only the distribution can fetch objects from the bucket; direct access to the S3 website or REST endpoint is rejected. This is the recommended AWS pattern because it relies on IAM evaluation of the caller identity rather than a client-controlled header or an IP-based allow list.

  • Make the S3 bucket private and use pre-signed URLs for CloudFront.

    Why it's wrong here

    Pre-signed URLs are designed for granting temporary, direct access to individual private S3 objects to specific users or applications, not for CloudFront to retrieve content from its origin. CloudFront cannot utilise pre-signed URLs to fetch objects from a private S3 bucket. This solution fails to provide the persistent, secure access mechanism (like an Origin Access Control) CloudFront requires to serve content. It is tempting as it addresses S3 privacy, and would be correct if the goal was to enable time-limited, direct client downloads of private files.

  • Use AWS WAF on CloudFront to block direct access to S3 by checking the Referer header.

    Why it's wrong here

    AWS WAF rules can inspect HTTP headers, but the Referer header is supplied by the client and can be trivially modified with tools like curl or browser extensions, so it does not establish the caller's identity. A user who knows the S3 REST URL can simply spoof a Referer that matches the allow condition, defeating the block. WAF is also not designed to restrict who can access an S3 origin directly; it only applies to traffic that arrives at CloudFront, leaving the S3 bucket endpoint itself unguarded unless a separate bucket policy enforce exists.

  • Create a VPC endpoint for S3 and restrict access to the bucket from the CloudFront IP addresses.

    Why it's wrong here

    VPC endpoints provide private connectivity between a VPC and AWS services, and the associated bucket policy condition can restrict access by the endpoint ID, not by CloudFront IP addresses. CloudFront's global edge IP range is large and dynamic, so a policy that references those IPs is brittle and operationally difficult to maintain. Furthermore, CloudFront does not originate from within a VPC, so it cannot traverse a VPC endpoint; the correct method is to grant the OAI or Origin Access Control access in the bucket policy.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This SOA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SOA-C02 exam.