DVA-C02 Security Practice Question
A developer is troubleshooting an IAM policy that is not working as expected. The policy has an Allow effect for s3:PutObject but the user gets AccessDenied. The user also has a Deny policy attached. What is the most likely reason?
⚠ Common exam trap
A common mix-up: candidates assume the order of policy evaluation (Allow before Deny) matters, but AWS explicitly states that an explicit Deny overrides any Allow, making the order irrelevant.
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
✓
An explicit Deny in an IAM policy overrides the Allow
AWS IAM evaluates all policies (identity-based, resource-based, and SCPs) and an explicit Deny always overrides any Allow, regardless of the order in which the policies are written. In this scenario, even though the user has an Allow effect for s3:PutObject, the attached Deny policy explicitly denies the action, resulting in an AccessDenied error. This is a fundamental rule of AWS authorization logic: an explicit Deny cannot be overridden by any Allow.
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 resource-based policy on S3 denies access
Why it's wrong here
A resource-based policy on S3 could indeed deny access, but the fundamental IAM evaluation logic dictates that an explicit Deny statement in *any* applicable policy, including an identity-based policy attached to the user, will always take precedence over any Allow statement. Therefore, even if the S3 bucket policy explicitly allowed the action, an explicit Deny in the user's IAM policy would still prevent access, making the user's identity policy the primary point of failure in this scenario related to an IAM policy not working as expected.
- ✗
The Allow policy is evaluated before the Deny policy
Why it's wrong here
The order in which Allow and Deny policies are conceptually 'evaluated' is irrelevant to the final access decision in AWS IAM. The system's logic is designed such that an explicit Deny statement, if present in any applicable policy, immediately overrides any Allow statements, regardless of their position or the sequence in which they might appear to be processed. This ensures that a clear prohibition always takes precedence, making the evaluation order a non-factor in the outcome.
- ✓
An explicit Deny in an IAM policy overrides the Allow
Why this is correct
This statement accurately reflects a core principle of AWS IAM policy evaluation. If an IAM policy contains an explicit Deny statement for a specific action on a resource, that Deny will always override any Allow statements that might exist in the same policy, other identity-based policies, or even resource-based policies. An explicit Deny acts as an absolute prohibition, ensuring that access is blocked even if multiple Allow statements are present.
- ✗
An SCP denies the action
Why it's wrong here
While Service Control Policies (SCPs) can indeed deny actions at the AWS Organizations account level, they operate as guardrails that set maximum permissions for an entire account, not directly for individual IAM principals within an account. The question specifically refers to troubleshooting an 'IAM policy' which implies an identity-based policy attached to a user or role within the account. An explicit Deny within such an IAM policy would be the more direct and specific cause of the issue described, rather than an SCP.
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
Courseiva writes every DVA-C02 question from scratch — 724 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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 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.