SCS-C02 Security Logging and Monitoring Practice Question
Exhibit
Refer to the exhibit.
IAM Policy JSON:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::my-bucket/*",
"Condition": {
"StringEquals": {
"s3:x-amz-server-side-encryption": "aws:kms"
}
}
},
{
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::my-bucket/*",
"Condition": {
"Null": {
"s3:x-amz-server-side-encryption": "true"
}
}
}
]
}Refer to the exhibit. A security engineer has attached this IAM policy to a user. What is the effect of this policy?
⚠ Common exam trap
Test-takers frequently assume `StringNotEquals` on a header condition will deny requests that omit the header, but in AWS IAM, missing condition keys cause the condition to evaluate to false, so the Deny does not apply — leaving unencrypted uploads allowed.
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
✓
Allows uploads with KMS encryption or without encryption.
The IAM policy uses a `Deny` effect with a `NotPrincipal` condition that denies uploads unless the request includes the `s3:x-amz-server-side-encryption` header with value `aws:kms`. However, the `Condition` block uses `StringNotEquals`, which means any request that does NOT have the encryption header set to `aws:kms` is denied. This effectively allows uploads with KMS encryption (header matches) or without encryption (no header present, because `StringNotEquals` does not match a missing header — the condition evaluates to false, so the Deny does not apply). Therefore, uploads without encryption are allowed by default (since there is no explicit Allow), and uploads with KMS encryption are also allowed.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Allows uploads with KMS encryption or without encryption.
Why this is correct
The bucket policy contains two separate allow statements that combine as an OR. One allow statement grants s3:PutObject when the request header s3:x-amz-server-side-encryption is set to aws:kms, covering KMS-encrypted uploads. The second allow statement grants s3:PutObject when the encryption header is absent, covering unencrypted uploads. Because AWS policies evaluate allow statements additively, the effective permission is exactly that uploads with KMS encryption or without encryption are allowed.
- ✗
Allows uploads only when encryption is not specified.
Why it's wrong here
This option says 'only when encryption is not specified,' but that ignores the first allow statement, which explicitly permits uploads with the s3:x-amz-server-side-encryption header set to aws:kms. Because that statement is an allow, a request that includes KMS encryption matches the policy and is permitted. Therefore the effective access is not limited to unencrypted uploads; KMS-encrypted uploads are also allowed, making the word 'only' incorrect.
- ✗
Denies uploads when encryption is not provided.
Why it's wrong here
This option claims unencrypted uploads are denied, but the second allow statement is written to match requests that do not specify the s3:x-amz-server-side-encryption header, so an upload without an encryption header is explicitly permitted. There is no explicit deny statement in the policy that would override that allow; a request that does not match the first statement's condition simply falls through to the second statement. Thus uploads without encryption are allowed, not denied.
- ✗
Allows uploads only when using KMS encryption.
Why it's wrong here
This option claims only KMS-encrypted uploads are allowed, but the second allow statement broadens the policy to also permit uploads without any encryption header. Even though the first statement covers requests with s3:x-amz-server-side-encryption: aws:kms, a request with no encryption header matches the second statement's condition and is allowed. Therefore the policy does not restrict uploads to only KMS encryption; it also permits unencrypted uploads, making 'only' incorrect.
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 SCS-C02 question is part of Courseiva's 1,205-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 SCS-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 SCS-C02 exam.