How to Enforce SSE-KMS Encryption on S3 Uploads Using Bucket Policy
Exhibit
2023-03-15T10:00:00Z my-bucket [13.48.75.23] arn:aws:sts::123456789012:assumed-role/DataAccessRole/JohnDoe 6F8C7A2B REST.PUT.OBJECT report.pdf "200" 256 "-" "-" "AES256" "-"
Refer to the exhibit. A data engineer reviews an Amazon S3 server access log entry for an object upload. The log shows a status of 200 and encryption status "AES256". The company policy requires that all data be encrypted with SSE-KMS. Which action should the engineer take to enforce this policy?
Quick Answer
The correct action is to attach an S3 bucket policy that denies s3:PutObject unless the request includes the x-amz-server-side-encryption header set to aws:kms. This is necessary because the server access log shows a successful upload with encryption status “AES256,” which indicates SSE-S3 was used, not the required SSE-KMS. A bucket policy is the only way to enforce encryption at upload time by rejecting any PutObject call that lacks the KMS encryption header, whereas default encryption settings only apply to objects uploaded without any encryption header and do not block SSE-S3 requests. On the AWS Certified Data Engineer Associate DEA-C01 exam, this scenario tests your understanding of how to enforce encryption policies using S3 bucket policies versus default encryption or CloudTrail, with a common trap being to confuse a successful upload log with correct encryption. Remember the key distinction: default encryption is passive, but a bucket policy is active enforcement—think “policy to police, default to defer.”
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
✓
Attach an S3 bucket policy that denies s3:PutObject unless the request includes x-amz-server-side-encryption: aws:kms
The log shows the object was uploaded with SSE-S3 (AES256), not the required SSE-KMS. To enforce the policy, the engineer should attach an S3 bucket policy that denies s3:PutObject unless the request includes the x-amz-server-side-encryption header set to aws:kms. Option D (default encryption) would encrypt new objects with SSE-KMS, but it does not block uploads that explicitly use SSE-S3; default encryption only applies when no encryption header is specified. Options B and C do not enforce the policy: revoking IAM permissions is too broad and CloudTrail only logs events.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Attach an S3 bucket policy that denies s3:PutObject unless the request includes x-amz-server-side-encryption: aws:kms
Why this is correct
Enforces SSE-KMS.
- ✗
Revoke the IAM role's s3:PutObject permission
Why it's wrong here
The role is allowed; the issue is encryption type.
- ✗
Enable AWS CloudTrail data events to monitor future uploads
Why it's wrong here
Monitoring does not enforce policy.
- ✗
Enable S3 default encryption with SSE-KMS on the bucket
Why it's wrong here
Default encryption does not override explicit SSE-S3 headers.
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,711 original DEA-C01 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 DEA-C01
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 data engineer needs to restrict access to an Amazon S3 bucket so that only objects encrypted with a specific AWS KMS key can be uploaded. Which S3 bucket policy condition should be used?
easy- ✓ A.s3:x-amz-server-side-encryption-aws-kms-key-id
- B.kms:ViaService
- C.s3:x-amz-server-side-encryption
- D.kms:EncryptionContext
Why A: The correct condition is s3:x-amz-server-side-encryption-aws-kms-key-id (option A). This condition key allows you to require that objects uploaded to the S3 bucket are encrypted with a specific AWS KMS key by checking the key ID used in the encryption header. Option B (kms:ViaService) restricts KMS key usage to specific AWS services but does not enforce a key ID on S3 objects. Option C (s3:x-amz-server-side-encryption) only checks whether server-side encryption is enabled, not the specific key. Option D (kms:EncryptionContext) is used to enforce encryption context, not the key ID.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DEA-C01 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 DEA-C01 exam.