Courseiva
SecurityhardMultiple ChoiceObjective-mapped

DVA-C02 Security Practice Question

A company uses an IAM role to allow an EC2 instance to access an S3 bucket. The bucket policy also grants access to the role. An application running on the instance is unable to read objects. The instance has the correct instance profile. What is the MOST likely cause?

⚠ Common exam trap

The trap here is that candidates often overlook bucket policy conditions and assume that if the IAM role has S3 permissions and the instance profile is attached, access should work, ignoring that bucket policies can impose additional restrictions that override role permissions.

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 bucket policy has a condition that does not match the request context.

The most likely cause is that the bucket policy includes a condition (e.g., aws:SourceIp, aws:SourceVpce, or aws:SecureTransport) that does not match the request context from the EC2 instance. Even though the IAM role grants access, the bucket policy's explicit condition denies the request if the condition key evaluates to false, resulting in an implicit deny. This is a common misconfiguration where the role has permissions but the bucket policy's conditions are too restrictive.

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 bucket policy has a condition that does not match the request context.

    Why this is correct

    An S3 bucket policy's conditions evaluate specific attributes of an incoming request, such as source IP, VPC endpoint ID, or specific tags. If any condition in an allow statement is not met, or if a condition in a deny statement *is* met, the request will be implicitly or explicitly denied, respectively. Therefore, even if the IAM role attached to the EC2 instance has the necessary S3 permissions, a mismatch with a restrictive bucket policy condition will prevent access.

  • The EC2 instance's security group blocks outbound traffic to S3.

    Why it's wrong here

    EC2 security groups control inbound and outbound network traffic to and from the EC2 instance's network interfaces, operating at the IP address and port level within a VPC. S3, however, is an AWS service accessed via its public endpoints or a VPC endpoint, not through direct IP communication with the EC2 instance's private IP. Consequently, security groups do not govern access to S3 and cannot block or allow S3 API calls.

  • The S3 bucket is in a different AWS account.

    Why it's wrong here

    While cross-account access to S3 buckets requires specific configurations, such as a bucket policy explicitly granting permissions to a principal in another AWS account, the question stem does not provide any information to suggest this scenario. Assuming the bucket is in a different account introduces an unsupported premise. Without explicit mention of cross-account context, this option is an unsubstantiated guess for the root cause of access denial.

  • The instance profile is not attached to the EC2 instance.

    Why it's wrong here

    The question explicitly states that the EC2 instance *has* the correct instance profile attached. An instance profile is the container for an IAM role that allows an EC2 instance to assume that role and obtain temporary credentials via the EC2 instance metadata service. Therefore, if the instance profile is correctly attached, the mechanism for the EC2 instance to assume the IAM role is functioning, making this option contradictory to the problem statement.

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

This DVA-C02 question is part of Courseiva's 724-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 →

How Courseiva writes practice questions · Editorial policy

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.