DVA-C02 Security Practice Question
A developer wants to ensure that an S3 bucket is not publicly accessible. Which TWO measures should the developer implement?
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
✓
Review the bucket policy to ensure it does not allow public access.
To prevent public access to an S3 bucket, two effective measures are: (1) reviewing the bucket policy (D) to ensure no statements grant public access, and (2) enabling S3 Block Public Access settings (E) which override any policies or ACLs that allow public access. Option A (server access logging) is for auditing access, not controlling it. Option B (versioning) is for preserving object versions. Option C (default encryption) protects data at rest, not access control.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Enable S3 server access logging.
Why it's wrong here
Enabling S3 server access logging records all requests made to the bucket, capturing details like source IP, requester, and operation type in log files that can be stored in another bucket. While this is valuable for auditing and post-incident analysis, logging has no effect on the bucket's authorization logic; it merely writes log objects. It does not alter the bucket policy, ACLs, or Block Public Access settings, so it cannot prevent anonymous users from reading objects. Therefore, it does not ensure the bucket is not public.
- ✗
Enable versioning on the bucket.
Why it's wrong here
Enabling versioning on the bucket causes S3 to retain multiple versions of each object, allowing you to preserve, retrieve, and restore previous states of an object. This is a data-protection and disaster-recovery feature that guards against accidental deletion or overwriting, but it does not change how access is evaluated. Whether a bucket is public depends entirely on its policy, ACLs, and Block Public Access settings, none of which are affected by versioning. A public bucket still serves all versions to any authenticated or anonymous requester who is allowed. Thus, versioning is not a valid method to restrict public access.
- ✗
Enable default encryption on the bucket.
Why it's wrong here
Enabling default encryption on the bucket ensures that every new object is automatically encrypted at rest using S3-managed keys (SSE-S3) or AWS KMS keys, protecting the data from unauthorized access at the storage layer. However, encryption is not an access control mechanism; it does not evaluate permissions or block requests. If the bucket is public, an anonymous user can still decrypt and retrieve objects because the encryption keys are managed by AWS and granted to authorized users based on IAM/policy evaluation. Encryption protects against data exposure if storage media is lost or accessed outside S3, but it does nothing to make the bucket private.
- ✓
Review the bucket policy to ensure it does not allow public access.
Why this is correct
Reviewing the bucket policy is a direct and necessary step because a bucket policy with a Principal of '*' and actions such as s3:GetObject or s3:ListBucket grants public read access to everyone. Even if the bucket ACLs and other settings appear restrictive, such a policy statement can make all objects publicly accessible. By auditing and removing any statement that grants access to 'Principal: *' or does not restrict access to specific AWS accounts, the developer can confirm that the bucket no longer publicly exposes objects. This complements Block Public Access, which provides a defensive override, but the policy itself is the actual source of public access.
- ✓
Enable S3 Block Public Access settings on the bucket.
Why this is correct
Enabling S3 Block Public Access settings on the bucket is a robust preventive measure that applies four independent controls: blocking new public ACLs, ignoring existing public ACLs, blocking new public bucket policies, and restricting access to only AWS services and authorized principals. These settings act as an explicit 'deny' that overrides any bucket policy or ACL statement that would allow public access, regardless of whether the statement is intentional or accidental. When all four settings are enabled, no public access can be granted via any mechanism, making the bucket definitively private. This is especially valuable in an environment with many users where a misconfigured policy might otherwise go unnoticed.
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 |
Go deeper
Related to this question
About these practice questions
This DVA-C02 question is part of Courseiva's 724-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.