- A
Configure the bucket to use SSE-S3 by default.
Why wrong: SSE-S3 does not use KMS.
- B
Enable default encryption on the bucket with SSE-KMS.
Why wrong: Default can be overridden by the client.
- C
Use a bucket policy that allows only PutObject with KMS encryption.
Why wrong: This would allow only KMS but not deny unencrypted uploads.
- D
Use a bucket policy that denies PutObject if the x-amz-server-side-encryption header is not 'aws:kms'.
This enforces KMS encryption on every upload.
Quick Answer
The answer is to use a bucket policy that denies PutObject if the `x-amz-server-side-encryption` header is not `aws:kms`. This works because a bucket policy operates at the API level, rejecting any upload that fails to specify KMS encryption, whereas default encryption settings like SSE-S3 can be overridden by the client’s request headers. On the AWS Certified Developer Associate DVA-C02 exam, this concept tests your understanding that bucket policies are the only reliable way to enforce encryption requirements, since client-side headers always take precedence over bucket defaults. A common trap is assuming that enabling default encryption alone is sufficient, but the exam expects you to recognize that a policy with a Deny effect is necessary to block non-compliant uploads. Memory tip: think “Deny the header, enforce the KMS” — if the header isn’t `aws:kms`, the policy slams the door.
DVA-C02 Security Practice Question
This DVA-C02 practice question tests your understanding of security. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
A company has an S3 bucket that contains sensitive data. The security team requires that all objects uploaded to the bucket must be encrypted at rest using AWS KMS. Which combination of actions will enforce this?
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 PutObject if the x-amz-server-side-encryption header is not 'aws:kms'.
Option D is correct because a bucket policy that denies PutObject requests when the `x-amz-server-side-encryption` header is not set to `aws:kms` enforces encryption at rest using AWS KMS for all uploads. This policy explicitly rejects any upload that does not include the required KMS encryption header, ensuring compliance with the security team's requirement. Default encryption settings (like SSE-S3 or SSE-KMS) can be overridden by the client, so a bucket policy is the only way to enforce encryption at the API level.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Configure the bucket to use SSE-S3 by default.
Why it's wrong here
SSE-S3 does not use KMS.
- ✗
Enable default encryption on the bucket with SSE-KMS.
Why it's wrong here
Default can be overridden by the client.
- ✗
Use a bucket policy that allows only PutObject with KMS encryption.
Why it's wrong here
This would allow only KMS but not deny unencrypted uploads.
- ✓
Use a bucket policy that denies PutObject if the x-amz-server-side-encryption header is not 'aws:kms'.
Why this is correct
This enforces KMS encryption on every upload.
Related concept
Read the scenario before looking for a memorised answer.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates often confuse default encryption with enforcement, not realizing that default encryption can be overridden by client-specified headers, whereas a bucket policy with a deny condition is the only way to mandate encryption at the API level.
Detailed technical explanation
How to think about this question
Under the hood, S3 bucket policies are evaluated before default encryption settings, so a policy with a `Deny` effect on `s3:PutObject` when `s3:x-amz-server-side-encryption` is not `aws:kms` will reject any upload that does not include the required header. This approach is critical because default encryption is a fallback that only applies if the request lacks encryption headers entirely; a malicious or misconfigured client could still send an object with `x-amz-server-side-encryption: AES256` and bypass SSE-KMS. In real-world scenarios, combining this policy with a condition that also checks for `s3:x-amz-server-side-encryption-aws-kms-key-id` can further restrict which KMS key is used.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A media company stores terabytes of video archives that are accessed once a year for audit purposes. Moving these objects to a cold storage tier (Azure Archive, S3 Glacier, or Google Nearline) costs a fraction of hot storage. Questions like this test whether you understand storage tiers, access frequency tradeoffs, and retrieval latency requirements.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
- →
Security — study guide chapter
Learn the concepts, then practise the questions
- →
Security practice questions
Targeted practice on this topic area only
- →
All DVA-C02 questions
1,616 questions across all exam domains
- →
AWS Certified Developer Associate DVA-C02 study guide
Full concept coverage aligned to exam objectives
- →
DVA-C02 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related DVA-C02 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Development with AWS Services practice questions
Practise DVA-C02 questions linked to Development with AWS Services.
Security practice questions
Practise DVA-C02 questions linked to Security.
Deployment practice questions
Practise DVA-C02 questions linked to Deployment.
Troubleshooting and Optimization practice questions
Practise DVA-C02 questions linked to Troubleshooting and Optimization.
DVA-C02 fundamentals practice questions
Practise DVA-C02 questions linked to DVA-C02 fundamentals.
DVA-C02 scenario practice questions
Practise DVA-C02 questions linked to DVA-C02 scenario.
DVA-C02 troubleshooting practice questions
Practise DVA-C02 questions linked to DVA-C02 troubleshooting.
Practice this exam
Start a free DVA-C02 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this DVA-C02 question test?
Security — This question tests Security — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Use a bucket policy that denies PutObject if the x-amz-server-side-encryption header is not 'aws:kms'. — Option D is correct because a bucket policy that denies PutObject requests when the `x-amz-server-side-encryption` header is not set to `aws:kms` enforces encryption at rest using AWS KMS for all uploads. This policy explicitly rejects any upload that does not include the required KMS encryption header, ensuring compliance with the security team's requirement. Default encryption settings (like SSE-S3 or SSE-KMS) can be overridden by the client, so a bucket policy is the only way to enforce encryption at the API level.
What should I do if I get this DVA-C02 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
3 more ways this is tested on DVA-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's S3 bucket contains sensitive data. The security team requires that all data be encrypted at rest. Which combination of actions will enforce encryption for all objects written to the bucket?
medium- ✓ A.Enable default encryption on the bucket and apply a bucket policy that denies PutObject if the x-amz-server-side-encryption header is missing or set to None.
- B.Use bucket ACLs to grant write access only to users who use encryption.
- C.Enable default encryption on the bucket and use bucket ACLs to restrict access.
- D.Create an AWS KMS key and attach a key policy that requires encryption.
Why A: Option C is correct because enabling default encryption and using a bucket policy to deny writes without encryption headers ensures all objects are encrypted. Option A is wrong because default encryption alone does not prevent unencrypted uploads. Option B is wrong because KMS key policies do not enforce encryption. Option D is wrong because bucket ACLs do not enforce encryption.
Variation 2. A company has an S3 bucket that stores sensitive customer data. The security team requires that all data be encrypted at rest using server-side encryption with AWS KMS. Additionally, they want to enforce that objects are not uploaded without encryption. Which bucket policy should be used?
medium- A.Deny s3:PutObject if the request includes x-amz-server-side-encryption
- ✓ B.Deny s3:PutObject unless the request includes x-amz-server-side-encryption with value aws:kms
- C.Allow s3:PutObject only if the request uses a specific KMS key
- D.Deny s3:PutObject unless the request includes x-amz-server-side-encryption with value AES256
Why B: Option B is correct because it uses a Deny effect with a condition that checks for the presence and value of the `x-amz-server-side-encryption` header. This policy explicitly denies any `s3:PutObject` request that does NOT include `x-amz-server-side-encryption` with the value `aws:kms`, thereby enforcing server-side encryption with AWS KMS (SSE-KMS) on all uploads.
Variation 3. A company requires that all data in an S3 bucket be encrypted at rest. The security team wants to enforce that only objects encrypted with AWS KMS are allowed. Which S3 bucket policy condition key should be used to deny PutObject requests if the object is not encrypted with KMS?
medium- A.s3:x-amz-server-side-encryption-key-id
- B.s3:x-amz-server-side-encryption
- C.s3:x-amz-server-side-encryption-kms-key-id
- ✓ D.s3:x-amz-server-side-encryption-aws-kms-key-id
Why D: Option D is correct because the `s3:x-amz-server-side-encryption-aws-kms-key-id` condition key specifically checks for the AWS KMS key ID (or alias) used for server-side encryption with AWS KMS (SSE-KMS). By using this key in a bucket policy with a `Deny` effect, you can enforce that only objects encrypted with a specific KMS key are allowed, rejecting any `PutObject` request that does not include the required `x-amz-server-side-encryption-aws-kms-key-id` header.
Keep practising
More DVA-C02 practice questions
- A developer is troubleshooting an AWS Lambda function that is triggered by an S3 event. The function occasionally fails…
- A developer needs to call AWS APIs from application code running on EC2. Which credential source should the AWS SDK use…
- A developer needs to allow an IAM user in a different AWS account to assume a role in the developer's account. The role…
- A developer needs to grant an IAM role in Account B read-only access to objects in an S3 bucket in Account A. The bucket…
- An API Gateway HTTP API should allow access only to users authenticated by an external OIDC provider. Which authorizer t…
- A developer monitors an AWS Lambda function that processes messages from an Amazon SQS queue. CloudWatch logs show that…
Last reviewed: Jun 24, 2026
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.