Question 1,534 of 724
DVA-C02 Security Practice Question
A developer is using CloudFront to serve content from an S3 bucket. The bucket contains sensitive data and should only be accessible through CloudFront. How can the developer enforce this?
⚠ Common exam trap
Many exam-takers assume restricting by CloudFront IP addresses (Option A) is a valid approach, but AWS explicitly warns that CloudFront IP ranges are not static and should not be used for access control in bucket policies.
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
✓
Create an origin access identity (OAI) and grant it read access in the bucket policy.
An Origin Access Identity (OAI) is a special CloudFront user that you can associate with your distribution. By configuring the S3 bucket policy to grant read access only to that OAI, you ensure that content can only be retrieved via CloudFront, not directly from the S3 endpoint. This enforces the requirement that the bucket is accessible exclusively through CloudFront.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Set the bucket policy to allow access only from CloudFront IP addresses.
Why it's wrong here
Setting a bucket policy to allow access only from CloudFront IP addresses is an unreliable and unscalable approach. CloudFront's edge locations utilize a large and dynamic range of IP addresses that are not static or publicly documented for this purpose. Relying on a fixed list of IPs would quickly become outdated, leading to intermittent access failures or requiring constant, impractical maintenance.
- ✗
Set the bucket policy to allow access only from AWS services.
Why it's wrong here
A bucket policy that broadly allows access from 'AWS services' is insufficiently granular for securing an S3 origin. This policy would permit access from various AWS services, not exclusively the specific CloudFront distribution intended, potentially exposing the content to other AWS accounts or services. It fails to enforce the principle of least privilege by not restricting access to the designated CloudFront distribution alone.
- ✗
Set the bucket policy to allow public read access and use CloudFront signed URLs.
Why it's wrong here
Granting public read access to the S3 bucket directly exposes all its content to the internet, irrespective of whether CloudFront signed URLs are employed. While signed URLs control access through CloudFront, the S3 bucket itself remains publicly accessible, creating a significant security vulnerability. This negates the purpose of securing the origin and is not a secure configuration for private content.
- ✓
Create an origin access identity (OAI) and grant it read access in the bucket policy.
Why this is correct
Creating an Origin Access Identity (OAI) and granting it read access in the S3 bucket policy is the recommended and most secure method. The OAI acts as a virtual user for your CloudFront distribution, allowing only that specific distribution to retrieve content from the S3 bucket. This prevents direct public access to the S3 bucket while enabling CloudFront to serve the content securely to end-users.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-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 →
Last reviewed: Jun 24, 2026
This DVA-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 DVA-C02 exam.
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.
Sign in to join the discussion.