Courseiva
Continuous Improvement for Existing SolutionsmediumMultiple ChoiceObjective-mapped

SAP-C02 Continuous Improvement for Existing Solutions Practice Question

Exhibit

Refer to the exhibit.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::example-bucket/*",
      "Condition": {
        "IpAddress": {
          "aws:SourceIp": "192.0.2.0/24"
        }
      }
    }
  ]
}

An IAM policy is attached to an S3 bucket to allow access only from a specific IP range. Users report that they can access the bucket from IP addresses outside the range. The bucket policy also includes another statement that denies access to all principals. What is the most likely reason users outside the IP range can still access the bucket?

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 deny statement does not apply to the users attempting to access the bucket.

An explicit deny in a bucket policy overrides any allow, but only if the deny statement applies to the principal making the request. If the deny statement specifies a different principal (e.g., an AWS account or role not matching the users), or includes a condition that does not evaluate to true for these users, the deny does not take effect. Therefore, the allow statement granting access based on IP range would still apply, allowing users outside the range to access the bucket. Option A is incorrect because the condition key syntax is not the issue; the deny is not applying to the correct principals. Option C is incorrect because the question states an IAM policy is attached to an S3 bucket, which is possible (resource-based policy), and the condition key 'aws:SourceIp' is valid. Option D is incorrect because the policy is attached to the bucket, not to individual users.

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 condition key 'aws:SourceIp' is misspelled.

    Why it's wrong here

    The condition key is correctly spelled.

  • The deny statement does not apply to the users attempting to access the bucket.

    Why this is correct

    The deny statement might be scoped to a different principal, allowing access from other IPs.

  • The policy is an IAM policy, not a bucket policy, and the condition key is invalid.

    Why it's wrong here

    The policy is a bucket policy (resource is S3 bucket arn).

  • The policy is attached to the IAM user instead of the bucket.

    Why it's wrong here

    The policy is a bucket policy, but it could be attached to IAM user as well; however, the issue is the deny not applying.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

One of 1,660 original SAP-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SAP-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 SAP-C02 exam.