How to Enforce SSE-KMS Encryption on S3 Uploads Using Bucket Policy
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?
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
✓
s3:x-amz-server-side-encryption-aws-kms-key-id
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.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
s3:x-amz-server-side-encryption-aws-kms-key-id
Why this is correct
The s3:x-amz-server-side-encryption-aws-kms-key-id condition key inspects the KMS key ID supplied in the upload request, so the bucket policy denies any PutObject not encrypted with the specified key. This directly enforces the stem's single-key upload restriction.
- ✗
kms:ViaService
Why it's wrong here
kms:ViaService only confirms the request reached KMS through S3; it cannot assert which key encrypted the object. It is designed to scope KMS key usage to a specific AWS service, which would be correct when restricting a key to S3 calls rather than pinning uploads to one key.
- ✗
s3:x-amz-server-side-encryption
Why it's wrong here
s3:x-amz-server-side-encryption checks only that the header names aws:kms, not which KMS key ID was used, so any customer-managed key satisfies it. It is the right condition when merely requiring SSE-KMS encryption rather than a specific key.
- ✗
kms:EncryptionContext
Why it's wrong here
kms:EncryptionContext matches key-value pairs in the KMS encryption context, not the key ARN itself, so uploads using other keys with matching context still pass. It suits enforcing contextual tagging of KMS operations, not pinning S3 uploads to one key.
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
Courseiva writes every DEA-C01 question from scratch — 1,321 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
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.