AWS

AWS S3 "Access Denied" (403 Forbidden): Find the Cause and Fix It

S3 returns the same 403 for many different reasons. This guide shows how to find the exact layer that denies the request and fix it.

Quick answer: S3 returns 403 when any layer denies the request: the caller's IAM policy doesn't allow the action, a bucket policy or organisation policy has an explicit Deny, Block Public Access stops public reads, the object is encrypted with a KMS key the caller can't use, or the bucket owner doesn't own the object. Identify the caller with 'aws sts get-caller-identity', check each layer in order, and use CloudTrail to see the denied call.

You run a simple command and S3 refuses:

An error occurred (AccessDenied) when calling the GetObject operation: Access Denied

S3 deliberately gives the same short message for very different problems. The fastest way to fix it is to check the layers in a fixed order instead of guessing.

What the error means

Every S3 request is evaluated against several policies. The request succeeds only if something allows it and nothing explicitly denies it:

LayerTypical problem
Identity (IAM user/role policy)Action or resource ARN not allowed
Bucket policyExplicit Deny, e.g. on HTTP, wrong VPC endpoint or IP
Block Public AccessBlocks public bucket policies and ACLs
KMS key policyCaller can't use the key that encrypts the object
Object ownership / ACLsObject uploaded by another account isn't owned by the bucket owner
Organisation SCP, permissions boundary, VPC endpoint policyDeny above the account or network level

How to fix it, step by step

1. Confirm who is making the request

Many 403s are simply the wrong credentials: an old profile, a different role, or an EC2 instance role you forgot about.

aws sts get-caller-identity

2. Check the IAM policy: actions and resource ARNs

Bucket-level and object-level actions use different ARNs. A very common mistake is granting only one of them:

{
  "Effect": "Allow",
  "Action": ["s3:ListBucket"],
  "Resource": "arn:aws:s3:::my-bucket"
},
{
  "Effect": "Allow",
  "Action": ["s3:GetObject", "s3:PutObject"],
  "Resource": "arn:aws:s3:::my-bucket/*"
}

Without s3:ListBucket, S3 returns 403 instead of 404 for objects that don't exist, which makes a simple typo in the key look like a permissions problem.

3. Look for an explicit Deny in the bucket policy

aws s3api get-bucket-policy --bucket my-bucket --query Policy --output text

Watch for "Effect": "Deny" statements with conditions such as aws:SecureTransport (HTTP blocked), aws:SourceVpce (only a VPC endpoint allowed) or aws:SourceIp. A Deny always wins.

4. Check Block Public Access (for public reads)

aws s3api get-public-access-block --bucket my-bucket

If you intend public access (for example a static website), these settings override your bucket policy. For production websites, CloudFront with origin access control is the safer pattern.

5. Check KMS permissions for encrypted objects

aws s3api head-object --bucket my-bucket --key reports/2026.csv

If the output shows "ServerSideEncryption": "aws:kms", the caller also needs kms:Decrypt (to read) and kms:GenerateDataKey (to write) on that key, allowed by both IAM and the key policy.

6. Fix object ownership for cross-account uploads

If another account uploaded the object, the bucket owner may not own it. Set Object Ownership to Bucket owner enforced (ACLs disabled) so the bucket owner owns every new object:

aws s3api put-bucket-ownership-controls --bucket my-bucket \
  --ownership-controls "Rules=[{ObjectOwnership=BucketOwnerEnforced}]"

7. Cross-account access needs both sides

For a role in account A reading a bucket in account B, account A's IAM policy must allow the action and account B's bucket policy must allow account A's role.

8. Use CloudTrail and the policy simulator to see the real reason

CloudTrail records denied calls with the principal and often which policy type denied it. The IAM policy simulator lets you test an action against a principal's policies before changing anything.

How to prevent it

  • Grant least privilege with both bucket and object ARNs, defined in code with Terraform.
  • Use Bucket owner enforced ownership on new buckets.
  • Document every Deny condition in bucket policies so teams know about them.
  • Test access with the policy simulator in CI before deploying policy changes.

IAM, bucket policies and KMS are core topics in our AWS training and data engineering on AWS programmes.

Frequently asked questions

Why does S3 return 403 instead of 404 for a missing file?

If the caller does not have s3:ListBucket on the bucket, S3 returns 403 Access Denied for objects that don't exist, so it doesn't reveal which keys exist. Grant s3:ListBucket to get a proper 404.

My IAM policy allows s3:*. Why do I still get Access Denied?

An explicit Deny anywhere wins over any Allow. Check the bucket policy, organisation SCPs, permissions boundaries, VPC endpoint policies and the KMS key policy if the object is encrypted with SSE-KMS.

How do I make an S3 object public?

Turn off the relevant Block Public Access settings on the bucket (and account), then add a bucket policy allowing s3:GetObject to Principal '*'. For websites, consider CloudFront with origin access control instead of a public bucket.

Learn AWS & AI on AWS hands-on with expert trainers

Fixing problems like this one is part of our AWS & AI on AWS training: live online classes for individuals and on-site corporate training for teams, with real projects and labs.

Training available in Hyderabad, Bangalore, Pune, Mumbai, Delhi, Chennai and online across India.