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
Does not enforce HTTPS between CloudFront and S3 unless Origin Protocol Policy is set to HTTPS-only.
- ✗
Enable default encryption on the bucket.
Why it's wrong here
Default encryption ensures at-rest encryption, not in-transit.
- ✓
Use a bucket policy that denies requests when aws:SecureTransport is false.
Why this is correct
Correctly enforces HTTPS by denying non-secure transport.
- ✗
Set the bucket policy to require SSE-KMS.
Why it's wrong here
SSE-KMS enforces at-rest encryption, not in-transit.
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 251 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 bucket policy requires TLS, meaning all requests must be made over HTTPS. If the application is using HTTP instead of HTTPS, the request will be denied. The AWS SDK by default uses HTTPS for S3 endpoints, but if the endpoint URL is explicitly set to HTTP or if the SDK configuration is changed, it could cause the issue. Option A is wrong because the bucket policy does not require specific cipher suites. Option B is wrong because IAM roles can access S3 if they have the right permissions. Option C is wrong because VPC endpoints do not affect the TLS requirement. Option D is correct: if the application is using HTTP, it violates the bucket policy condition.
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.