MLS-C01 Data Engineering Practice Question
Exhibit
Refer to the exhibit.
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": "arn:aws:s3:::my-data-lake/*"
},
{
"Effect": "Deny",
"Action": "s3:*",
"Resource": "arn:aws:s3:::my-data-lake/confidential/*",
"Condition": {
"StringNotEquals": {
"aws:PrincipalAccount": "123456789012"
}
}
}
]
}
```Refer to the exhibit. An IAM policy is attached to a data engineering team's role. The team needs to upload data to the 'confidential' prefix in the 'my-data-lake' bucket. However, they are receiving 'AccessDenied' errors. What is the likely cause?
⚠ Common exam trap
The AWS exam often tests the principle that an explicit Deny overrides any Allow, and candidates mistakenly focus on the Allow statement's permissions (like missing ListBucket) instead of recognizing that the Deny statement with a condition is the root cause of the 'AccessDenied' error.
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 with the condition explicitly denies access to the 'confidential' prefix for accounts other than 123456789012.
The Deny statement explicitly denies access to the 'confidential' prefix when the request comes from an AWS account other than 123456789012. Since the data engineering team's role likely belongs to a different account, the Deny condition matches and overrides any Allow statements, resulting in an 'AccessDenied' error. In IAM, an explicit Deny always takes precedence over an Allow, so even if the Allow statement grants PutObject, the Deny blocks the upload.
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 in the Deny statement requires the team to use a specific source IP address.
Why it's wrong here
The condition uses aws:PrincipalAccount, not source IP.
- ✗
The Allow statement only grants GetObject and PutObject, but the team needs ListBucket.
Why it's wrong here
The error is AccessDenied for PutObject, which is allowed in the Allow statement, but the Deny overrides it.
- ✓
The Deny statement with the condition explicitly denies access to the 'confidential' prefix for accounts other than 123456789012.
Why this is correct
The Deny statement applies to all actions on the confidential prefix for accounts not matching 123456789012, overriding the Allow.
- ✗
The Allow statement's resource does not include the 'confidential' prefix.
Why it's wrong here
The Allow statement includes all objects under my-data-lake, including confidential, but the Deny overrides.
Go deeper
Related to this question
About these practice questions
Courseiva writes every MLS-C01 question from scratch — 1,672 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 MLS-C01 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 MLS-C01 exam.