Cloud Engineer interview question · Most asked
An application on AWS suddenly gets AccessDenied when reading from S3. How do you troubleshoot it?
Scenario Asked in Cloud Engineer · DevOps Engineer interviews
Summary
Find out exactly which principal made the call and which policy denied it: the error message and CloudTrail show the role and the action. Then check every layer that can deny: the role's IAM policy, the bucket policy, permission boundaries and organisation SCPs, KMS key policies for encrypted objects, VPC endpoint policies and object ownership.
Longer Answer
- Who and what:
aws sts get-caller-identityfrom the workload; CloudTrail event witherrorCodeAccessDenied (newer messages name the policy type that denied it). - Identity policy: does the role allow
s3:GetObjectonarn:aws:s3:::bucket/*(objects, not just the bucket ARN)? - Bucket policy: explicit denies (for example requiring a VPC endpoint or TLS).
- KMS: SSE-KMS objects need
kms:Decrypton the key, and the key policy must allow the role. - Guardrails: SCPs, permission boundaries, VPC endpoint policies.
- Ownership: objects uploaded by another account with ACLs disabled or enforced.
- What changed: a recent policy deploy, key rotation to a new key, role change, or credentials now coming from a different role (IRSA misconfiguration). The IAM policy simulator and IAM Access Analyzer help confirm the fix.
Key Points
- Identify the principal and action from CloudTrail.
- Check identity, bucket, KMS and endpoint policies.
- SCPs and boundaries can deny silently.
- Object vs bucket ARNs.
- Look at what changed.
Explanation
What interviewers look for
Knowing all the layers that can deny an S3 request and a systematic way through them.
More Cloud Engineer questions
- How do you keep object storage buckets from being exposed publicly?
- How do you approach cloud cost optimisation?
- Design a highly available web application on AWS that survives the loss of an availability zone.
- What are regions and availability zones, and how do you use them for resilience?
- What do Multi-AZ deployments and read replicas give you for managed databases?
- How is an AWS IAM request evaluated when several policies apply?
- How do you eliminate long-lived credentials in a cloud environment?
- Explain RTO and RPO and the four disaster recovery strategies.