DOP-C02 Resilient Cloud Solutions Practice Question
Exhibit
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::my-bucket/*"
},
{
"Effect": "Deny",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::my-bucket/confidential/*",
"Condition": {
"StringNotEquals": {
"s3:x-amz-server-side-encryption": "aws:kms"
}
}
}
]
}Refer to the exhibit. An IAM policy is attached to a user. A developer tries to upload an object to s3://my-bucket/confidential/report.pdf without specifying server-side encryption. What will happen?
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
✓
The upload fails because the Deny statement requires SSE-KMS.
The upload fails because the Deny statement in the IAM policy explicitly denies the s3:PutObject action unless the request includes the s3:x-amz-server-side-encryption header with a value of 'aws:kms'. When the developer does not specify server-side encryption, the condition is not met, so the Deny applies, causing the upload to fail. Option A is incorrect because the Allow statement does not override an explicit Deny. Option B is incorrect because the condition key is correct; the failure is due to the missing encryption header. Option D is incorrect because the Deny is not based on the object name prefix; it applies to all objects in the bucket.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The upload succeeds because the Allow statement grants PutObject.
Why it's wrong here
An explicit Deny in the policy overrides the Allow, so PutObject is blocked when server-side encryption is absent. The Allow alone is tempting because it does grant PutObject, but it is evaluated alongside the Deny, which takes precedence.
- ✗
The upload succeeds because the Deny condition uses a wrong condition key.
Why it's wrong here
The Deny uses valid condition keys (s3:x-amz-server-side-encryption), so it does block the unencrypted upload. A wrong condition key is tempting because malformed keys silently fail to match, but here the key is correct and the Deny is effective.
- ✓
The upload fails because the Deny statement requires SSE-KMS.
Why this is correct
An explicit Deny in the IAM policy overrides any Allow, and it is conditioned on the absence of SSE-KMS encryption headers. Because the request specifies no server-side encryption, the Deny matches and the upload is rejected.
- ✗
The upload fails only if the object name matches the prefix.
Why it's wrong here
The Deny applies to the confidential/ prefix regardless of object name matching, so the upload fails whenever encryption is missing. Prefix matching is tempting because Deny conditions often scope by resource ARN, but here the condition keys encryption and prefix both trigger the block.
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 DOP-C02 question is part of Courseiva's 1,298-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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DOP-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 DOP-C02 exam.