DVA-C02 Security Practice Question
A developer wants to enforce that all requests to an Amazon S3 bucket must use HTTPS (TLS). The bucket is used for static website hosting. Which bucket policy condition should be used to deny requests that do not use HTTPS?
⚠ Common exam trap
It's easy for candidates to confuse `aws:SecureTransport` with `aws:SourceVpc` or `aws:Referer`, or mistakenly think setting the condition to `true` in a Deny statement will block non-HTTPS traffic, when in fact it would block HTTPS traffic instead.
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
✓
"aws:SecureTransport": "false"
The `aws:SecureTransport` condition key evaluates to `false` when the request is not sent over HTTPS (TLS). By using a Deny effect with this condition set to `false`, the policy blocks any HTTP requests to the S3 bucket, ensuring all traffic uses encrypted connections. This is a standard approach for enforcing TLS on S3 buckets, including those used for static website hosting.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
"aws:SecureTransport": "false"
Why this is correct
This option correctly enforces HTTPS. When used in a Deny statement within an S3 bucket policy, the condition `"aws:SecureTransport": "false"` explicitly blocks any request that is *not* using HTTPS. By denying all unencrypted requests, the policy effectively mandates that all successful interactions with the S3 bucket must utilize HTTPS (TLS) for data in transit, ensuring secure communication.
- ✗
"aws:SecureTransport": "true"
Why it's wrong here
This option is incorrect because using `"aws:SecureTransport": "true"` in a Deny statement would explicitly block all requests that *are* using HTTPS. This would prevent secure access to the S3 bucket, leaving only unencrypted HTTP requests to be potentially allowed, which is the opposite of the desired security posture to enforce secure transport.
- ✗
"aws:SourceVpc": "true"
Why it's wrong here
This option is incorrect because the `aws:SourceVpc` condition key is used to restrict access to an S3 bucket based on the Virtual Private Cloud (VPC) from which the request originates. It evaluates whether a request comes from a specified VPC endpoint. This condition has no bearing on whether the transport layer itself is encrypted (HTTPS) or unencrypted (HTTP), making it irrelevant for enforcing secure transport.
- ✗
"aws:Referer": "https"
Why it's wrong here
This option is incorrect because the `aws:Referer` condition key checks the HTTP `Referer` header, which indicates the URL of the webpage that linked to the requested resource. While it can be used for hotlinking protection or to restrict access to requests originating from specific websites, it does not enforce encryption in transit for the current request. The presence of "https" in the Referer header does not guarantee the current connection is secure.
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
One of 724 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.