You attach AmazonS3FullAccess or double-check your IAM role, run aws s3 cp, and still get:
An error occurred (403) when calling the GetObject operation: Forbidden In AWS, S3 authorization fails with 403 AccessDenied whenever any one of five independent evaluation layers denies or omits permission. Checking only the IAM role misses four of them.
Here is the 5-layer debugging order that isolates the exact blocker in minutes.
Layer 1: IAM Identity Policy vs. Bucket vs. Object ARN
The classic mismatch in custom S3 policies:
{ "Effect": "Allow", "Action": ["s3:GetObject", "s3:PutObject"], "Resource": "arn:aws:s3:::my-prod-bucket" } s3:ListBucket operates on the bucket ARN (arn:aws:s3:::my-prod-bucket), while s3:GetObject / s3:PutObject require the object ARN (arn:aws:s3:::my-prod-bucket/*). Without /*, object reads return 403.
Layer 2: S3 Bucket Policy Explicit Deny
Even AdministratorAccess loses to an explicit Deny in the bucket policy. Watch out for:
-
aws:SourceVpce/aws:SourceIprestrictions blocking CI runners or NAT gateways -
StringNotEquals: { "s3:x-amz-server-side-encryption": "aws:kms" }rejecting uploads missing the KMS header
Layer 3: SSE-KMS Key Policy (The #1 Hidden 403)
If the bucket encrypts objects with a customer-managed KMS key (CMK), your IAM user/role needs both S3 permissions AND KMS permissions (kms:Decrypt for reads, kms:GenerateDataKey for writes).
Moreover, for a CMK, both the IAM policy and the KMS Key Policy must allow access (an IAM policy alone cannot grant access to a CMK unless the Key Policy delegates to the account root).
Layer 4: AWS Organizations SCP & Permissions Boundaries
In multi-account orgs, Service Control Policies (SCPs) act as an upper bound across every IAM principal in the member account. Common blockers include region restrictions (aws:RequestedRegion) or mandatory encryption conditions.
Layer 5: Block Public Access & BucketOwnerEnforced
New S3 buckets default to Object Ownership: BucketOwnerEnforced (ACLs disabled). Legacy SDK calls passing ACL: 'public-read' or 'bucket-owner-full-control' fail with 403 / AccessControlListNotSupported.
Quick Diagnostic Commands
# 1. Confirm which IAM ARN / assumed role is active aws sts get-caller-identity # 2. Simulate exact action evaluation without guessing aws iam simulate-principal-policy \ --policy-source-arn arn:aws:iam::123456789012:role/app-role \ --action-names s3:GetObject kms:Decrypt \ --resource-arns arn:aws:s3:::my-prod-bucket/test.json # 3. Check if the object uses SSE-KMS aws s3api head-object --bucket my-prod-bucket --key test.json --query ServerSideEncryption Full Reference & Offline Debugging Utilities
- Complete 5-Layer Guide: AWS S3 403 Access Denied: 5-Layer Production Debugging Checklist
- Saved Gist Checklist: aws-s3-403-access-denied-5-layer-checklist.md
- Check
aws:SourceIpCIDR ranges offline: NerdKit CIDR Subnet Calculator - Format IAM & Bucket Policy JSON locally (0 bytes uploaded): NerdKit JSON Formatter