Enforce HTTPS for S3 Access — Bucket Policy with SecureTransport
A company requires that all access to their S3 buckets be encrypted in transit. Which configuration achieves this?
Quick Answer
The correct answer is to use an S3 bucket policy that denies requests when `aws:SecureTransport` is false. This configuration enforces HTTPS for S3 access by explicitly blocking any HTTP or non-TLS requests, ensuring all data in transit is encrypted. On the AWS Certified DevOps Engineer Professional DOP-C02 exam, this tests your understanding of S3 security controls and IAM policy conditions, often appearing as a scenario where a company must meet compliance requirements for encryption in transit. A common trap is confusing this with server-side encryption settings or bucket ACLs, which do not control transport-layer security. Remember the key condition: `aws:SecureTransport` evaluates to `true` for HTTPS and `false` for HTTP; by denying when false, you enforce HTTPS. A helpful memory tip is "Deny the false to force the secure path"—if SecureTransport is false, the request is denied, guaranteeing encrypted transit.
⚠ Common exam trap
A common mix-up: candidates confuse encryption in transit with encryption at rest; candidates often pick options like default encryption or SSE-KMS, which only address data at rest, not the requirement for HTTPS enforcement.
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
✓
Use a bucket policy that denies requests when aws:SecureTransport is false.
Using a bucket policy with a condition that denies requests when `aws:SecureTransport` is `false` explicitly enforces encryption in transit for all access to the S3 bucket. This policy ensures that any HTTP (non-TLS) request is denied, while HTTPS requests are allowed, meeting the requirement that all access be encrypted in transit.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use CloudFront with the bucket as origin and enforce HTTPS only between viewer and CloudFront.
Why it's wrong here
Enforcing HTTPS only between viewer and CloudFront leaves the CloudFront-to-origin leg unencrypted, so bucket access still permits plain HTTP. It is tempting because CloudFront viewer policies genuinely secure client connections, which is the correct approach when the requirement covers only public edge traffic.
- ✗
Enable default encryption on the bucket.
Why it's wrong here
Default encryption applies SSE-S3 or SSE-KMS at rest; it does not reject plain HTTP requests, so data can still travel unencrypted in transit. It is tempting because default encryption is the standard control for encryption-at-rest requirements, and the two encryption contexts are easily conflated.
- ✓
Use a bucket policy that denies requests when aws:SecureTransport is false.
Why this is correct
A bucket policy denying requests where `aws:SecureTransport` is false enforces HTTPS-only access, directly satisfying the in-transit encryption requirement. This condition evaluates the TLS state of each request, so any plain HTTP call to the bucket is rejected regardless of IAM permissions, ensuring all access is encrypted in transit.
- ✗
Set the bucket policy to require SSE-KMS.
Why it's wrong here
SSE-KMS governs server-side encryption at rest; a bucket policy requiring it does not deny requests made over HTTP, so transit remains unprotected. It is tempting because bucket policies with aws:SecureTransport conditions do enforce TLS, but the SSE-KMS condition itself addresses storage, not transport.
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 1,298 original DOP-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 →
Same concept, more angles
1 more way this is tested on DOP-C02
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A company runs a critical application on EC2 instances that need to access an S3 bucket with sensitive data. The security team has enabled S3 bucket policies that require TLS for all requests (aws:SecureTransport). The application is failing to access the S3 bucket, and logs show errors like 'Access Denied'. The application uses the AWS SDK to make requests. What is the most likely cause of the failure?
medium- A.The S3 bucket is accessed through a VPC endpoint that does not support TLS.
- B.The application's IAM role does not have s3:GetObject permission.
- C.The bucket policy requires a specific TLS version that the application does not support.
- ✓ D.The application is using HTTP instead of HTTPS to connect to S3.
Why D: The scenario states the application is failing specifically because the bucket policy enforces aws:SecureTransport, and the symptom described (Access Denied consistent with a TLS-enforcement deny) points to the request being made over plain HTTP, not to a missing IAM permission. A missing s3:GetObject permission would also produce an Access Denied error, but it would occur regardless of the request's transport protocol and would not be tied to the specific TLS-enforcement condition described in the scenario. Since the question specifies the security team's TLS-enforcing bucket policy as the relevant control, and the failure aligns with that policy's deny condition, an IAM permissions gap is not the most likely cause here.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DOP-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 DOP-C02 exam.