S3 Bucket Policy to Enforce SSE-KMS Encryption
A company uses Amazon S3 to store sensitive customer data. The security team requires that all objects uploaded to a specific bucket be encrypted at rest using AWS KMS with a customer managed key. Which bucket policy statement should be applied to enforce this requirement?
Quick Answer
The correct answer is to apply a bucket policy that denies s3:PutObject unless the s3:x-amz-server-side-encryption-aws-kms-key-id condition key matches the specific customer managed KMS key ARN. This works because the policy uses a Deny effect with a conditional StringNotEquals check, which explicitly blocks any upload that does not include the required KMS key ID, thereby enforcing SSE-KMS encryption at the bucket level. On the AWS Certified Data Engineer Associate DEA-C01 exam, this scenario tests your understanding of how to combine S3 bucket policies with KMS condition keys to enforce encryption requirements, a common trap being that an Allow with a condition is weaker than a Deny for security enforcement. A useful memory tip is “Deny unless the key matches”—remember that you must explicitly deny non-compliant uploads rather than just allowing compliant ones, because S3 policies default to an implicit allow for the bucket owner.
⚠ Common exam trap
Test-takers frequently confuse the condition key s3:x-amz-server-side-encryption (which only checks for SSE-S3 or SSE-KMS) with s3:x-amz-server-side-encryption-aws-kms-key-id (which checks for a specific KMS key), leading them to pick Option A or D instead of C.
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
✓
Deny s3:PutObject unless s3:x-amz-server-side-encryption-aws-kms-key-id equals the specific KMS key ARN
The security team requires encryption at rest using AWS KMS with a customer managed key. The bucket policy must deny any s3:PutObject request that does not include the s3:x-amz-server-side-encryption-aws-kms-key-id condition key set to the specific KMS key ARN. This ensures that only objects encrypted with the designated customer managed key are allowed, enforcing the encryption requirement at the bucket policy level.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Deny s3:PutObject unless s3:x-amz-server-side-encryption is present
Why it's wrong here
This only enforces that some form of encryption is used, not necessarily KMS with the specific key.
- ✗
Allow s3:PutObject only if s3:x-amz-server-side-encryption is present
Why it's wrong here
This allows but does not enforce KMS; also, it does not require the specific key.
- ✓
Deny s3:PutObject unless s3:x-amz-server-side-encryption-aws-kms-key-id equals the specific KMS key ARN
Why this is correct
This condition ensures only the specified KMS key is used for encryption.
- ✗
Deny s3:PutObject unless s3:x-amz-server-side-encryption equals AES256
Why it's wrong here
This enforces SSE-S3, not KMS.
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 DEA-C01 question is part of Courseiva's 1,711-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 →
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 company stores sensitive customer data in Amazon S3. The security team requires that all data be encrypted at rest using server-side encryption with AWS KMS managed keys (SSE-KMS). Which S3 bucket policy condition will enforce this requirement?
easy- ✓ A.s3:x-amz-server-side-encryption-aws-kms-key-id
- B.s3:x-amz-server-side-encryption-customer-algorithm
- C.s3:x-amz-server-side-encryption
- D.s3:x-amz-server-side-encryption-aws-kms-key-id or s3:x-amz-server-side-encryption
Why A: The condition `s3:x-amz-server-side-encryption-aws-kms-key-id` enforces that objects uploaded to S3 must use a specific AWS KMS key for server-side encryption (SSE-KMS). This satisfies the security team's requirement that all data be encrypted at rest using SSE-KMS with AWS KMS managed keys, as it explicitly checks for the presence and value of the KMS key ID in the request. Option C, `s3:x-amz-server-side-encryption`, can also enforce SSE-KMS if the condition value is set to 'aws:kms', but it does not require a specific KMS key ID, which the question's phrasing 'AWS KMS managed keys' implies is needed.
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.