DVA-C02 Security Practice Question
A company uses AWS KMS to encrypt data at rest in S3. The security team requires that all objects uploaded to a specific S3 bucket must be encrypted with a specific KMS key (key ID: xyz). The developer needs to enforce this by denying any PutObject request that does not use the correct key. Which bucket policy condition should be used?
⚠ Common exam trap
It's easy for candidates to confuse S3-specific condition keys (like `s3:x-amz-server-side-encryption-aws-kms-key-id`) with KMS condition keys (like `kms:EncryptionContext`), leading candidates to pick a KMS condition key that does not apply to S3 bucket policies.
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 `s3:x-amz-server-side-encryption-aws-kms-key-id` condition key allows you to enforce that a specific KMS key ID (e.g., `xyz`) is used for server-side encryption with AWS KMS (SSE-KMS). By including this condition in a bucket policy with a `Deny` effect, any `PutObject` request that does not specify the required key ID will be denied, meeting the security team's requirement.
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
This condition key, `s3:x-amz-server-side-encryption-aws-kms-key-id`, is precisely designed for S3 bucket policies to enforce the use of a *specific* AWS KMS customer master key (CMK) when objects are uploaded with server-side encryption using KMS (SSE-KMS). By including this condition, an S3 bucket policy can mandate that all incoming objects encrypted with SSE-KMS must utilize a predefined KMS key ARN, preventing uploads encrypted with unauthorized or default KMS keys. This ensures strict compliance with data residency or security requirements by linking data to a specific cryptographic key.
- ✗
kms:EncryptionContext
Why it's wrong here
The `kms:EncryptionContext` condition key is primarily utilized within AWS KMS key policies to control access based on the encryption context provided during KMS API calls (e.g., Encrypt, Decrypt). While encryption context is relevant to KMS operations, it is not a condition key directly available or evaluated within an S3 bucket policy to restrict object uploads. S3 bucket policies operate on S3-specific request headers and attributes, not the internal KMS encryption context details.
- ✗
s3:EncryptionAlgorithm
Why it's wrong here
There is no standard S3 condition key named `s3:EncryptionAlgorithm` available for use in S3 bucket policies. The type of server-side encryption (e.g., SSE-S3, SSE-KMS, SSE-C) is typically specified by the `x-amz-server-side-encryption` request header. While the underlying encryption algorithm (e.g., AES256) is used, S3 bucket policies do not offer a granular condition key to directly evaluate or enforce specific cryptographic algorithms for object uploads.
- ✗
kms:GrantOperations
Why it's wrong here
The `kms:GrantOperations` condition key is exclusively used within AWS KMS grant policies, which are a mechanism to delegate permissions to use a KMS key to other AWS principals. It allows specifying which KMS API operations (e.g., Encrypt, Decrypt, GenerateDataKey) a grantee is permitted to perform. This condition is entirely unrelated to S3 bucket policies, which govern access to S3 objects and buckets, not the creation or management of KMS grants.
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 DVA-C02 question from scratch — 724 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 DVA-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 DVA-C02 exam.