Prefer video? The full walkthrough is at the top of this post, and the most common cases have one-minute Shorts right where they come up. This guide first went out on the AWS Cloud in a Minute newsletter.

The one-minute answer

The problem: your IAM policy looks right, and S3 still returns 403 Access Denied.

How S3 decides: an explicit Deny anywhere beats every Allow, and without at least one Allow the answer is no. “Anywhere” is much more than your IAM policy: the bucket policy, SCPs and RCPs in AWS Organizations, permissions boundaries, session policies, VPC endpoint policies, Block Public Access and KMS key policies all get a say.

Where to look first: read the full error message. For requests in the same account or organization it names the type of policy, and says either explicit deny or no ... policy allows. That tells you which of the causes below to check.

The rest of this guide goes through the causes one by one, in the order worth checking, and ends with a checklist.

The same three checks, in under a minute:

How S3 decides

Every request starts as denied. AWS then looks at every policy that applies and follows three rules:

  1. An explicit Deny in any policy wins. Nothing overrides it.
  2. Otherwise the request needs an Allow. No Allow anywhere means an implicit deny.
  3. Some policies only set a ceiling. SCPs, RCPs, permissions boundaries and session policies never grant anything. They have to allow the action as well, or it’s denied. One exception in the same account: a bucket policy that names your IAM user or your exact role session ARN isn’t held back by a missing Allow in a boundary or session policy. An explicit Deny still wins.

Where the bucket lives changes rule 2:

  • Same account: an Allow in either your IAM policy or the bucket policy is enough.
  • Another account: both have to allow it. Your IAM policy in your account, and the bucket policy in theirs. If the object is encrypted with their KMS key, the key policy has to allow you too.

Read the error first

Most S3 Access Denied messages follow one pattern, and the last part is the clue:

User arn:aws:sts::111122223333:assumed-role/app-role/session is not authorized to perform s3:GetObject on "arn:aws:s3:::my-bucket/report.csv" because no identity-based policy allows the s3:GetObject action 

It ends in one of two ways:

  • with an explicit deny in a ... policy: something says Deny. Find that statement. For SCPs, RCPs, identity-based policies, session policies and permissions boundaries, the message includes the ARN of the policy that denied you.
  • because no ... policy allows the ... action: nothing says Allow. An Allow is missing in the type of policy it names.

The type tells you where to look: identity-based, resource-based (the bucket policy), service control policy, resource control policy, permissions boundary, session policy or VPC endpoint policy.

You only get a plain Access Denied with no detail for cross-account requests outside your organization and for directory buckets, and AWS notes the detail can also be missing when a VPC endpoint policy is what blocked you. The same context is recorded in CloudTrail.

The causes, one by one

Check them in this order. The first three explain an explicit deny, the next two explain most implicit ones.

Something says Deny

1. A Deny in the bucket policy. Bucket policies often deny everything that doesn’t meet a condition, such as aws:SourceVpce (only through one VPC endpoint) or aws:SourceVpc (only from one VPC). Your IAM Allow can’t beat that, and a Deny in a bucket policy applies to every object in the bucket, whoever owns it. A common surprise: a policy like this also blocks the S3 console, because console requests don’t come from your VPC endpoint.

Fix: find the Deny statement and the condition your request fails, then send the request the expected way or add an exception for your role.

2. An SCP or RCP in AWS Organizations. Service control policies limit what your account’s identities can do. Resource control policies limit what can be done to resources, S3 buckets and customer managed KMS keys included (not AWS managed keys). Neither grants anything, and the message names the one that blocked you. RCPs don’t apply to resources in the management account.

Fix: you usually can’t change these yourself. Send the policy ARN from the error to whoever runs your organization.

3. A permissions boundary or session policy. Both set a ceiling. With a boundary, your role can do only what both its policies and its boundary allow. A session policy, passed when the role is assumed, limits that session the same way.

Fix: add the S3 action to the boundary or session policy, not only to the role.

Your Allow doesn’t match the request

4. The policy points at the wrong ARN. s3:ListBucket works on the bucket. s3:GetObject and s3:PutObject work on the objects inside it. Mix them up and the Allow never matches.

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

5. The object doesn’t exist. If you don’t have s3:ListBucket, S3 answers a request for a missing key with 403 Access Denied, not 404 Not Found. A typo in the key, the wrong prefix or the wrong case looks exactly like a permissions problem.

Fix: check the key, or grant s3:ListBucket so missing objects return 404.

Encryption

6. The object is encrypted with a KMS key you can’t use. With SSE-KMS and a customer managed key, uploads need kms:GenerateDataKey, and downloads and multipart uploads need kms:Decrypt. The CLI switches to multipart for large files, so a role with only kms:GenerateDataKey can upload small files and fail on big ones. The key policy has to allow you as well as your IAM policy. With the AWS managed key (aws/s3), only principals in the key’s own account can use it, so objects encrypted with it can’t be shared with another account.

Fix: add the KMS permission on that key, and check its key policy. To share encrypted objects across accounts, use a customer managed key.

This one is the most watched Short on the channel, so here it is in under a minute:

Another account is involved

7. Only one side allows it. Cross-account access needs an Allow in your IAM policy and in their bucket policy. With a customer managed KMS key, the same goes for the key: their key policy and your IAM policy. Outside your organization you also only get a plain Access Denied, so check both sides.

8. The object belongs to another account. If the bucket still uses ACLs (Object Ownership set to Object writer, or Bucket owner preferred without the bucket-owner-full-control ACL on upload), an object uploaded by another account is owned by that account. A bucket policy Allow only covers objects the bucket owner owns, so the bucket owner’s own users can be denied.

Fix: move any ACL permissions into the bucket policy, then set Object Ownership to Bucket owner enforced (the default for new buckets). That turns ACLs off and makes the bucket owner own every object.

Network and public access

9. Block Public Access. It overrides bucket policies and ACLs that grant public access, and it’s on by default for new buckets. If your bucket policy counts as public, the RestrictPublicBuckets setting also blocks cross-account requests, not only anonymous ones. When the settings differ, S3 applies the most restrictive combination across the organization, account, bucket and access point levels.

10. The VPC endpoint policy. A request through an S3 VPC endpoint is also checked against the endpoint’s policy. The default allows everything, but a custom policy that lists only certain buckets blocks the rest, often with no detail in the error.

Fix: add the bucket to the endpoint policy, or test from outside the VPC to confirm.

Billing

11. Requester Pays. If the bucket owner enabled Requester Pays, requests from other accounts have to say they’ll pay. In the CLI, add --request-payer requester. In an SDK, set the x-amz-request-payer header to requester.

How to check it

Run these from the same place as the failing app, with the same credentials.

1. Confirm who you are. The request often runs as a different role than the one you edited:

aws sts get-caller-identity 

2. Read the full error. The CLI prints it as is. In an SDK, log the exception message, not only the status code. CloudTrail records the same context, so you can also find the failed call there and read its error message.

3. Look at the object and the bucket.

aws s3api head-object --bucket my-bucket --key report.csv aws s3api get-bucket-policy --bucket my-bucket aws s3api get-bucket-ownership-controls --bucket my-bucket aws s3api get-public-access-block --bucket my-bucket 

head-object shows whether the object exists and which KMS key encrypts it (ServerSideEncryption and SSEKMSKeyId). The other three cover causes 1, 8 and 9.

4. Test the policy. The IAM policy simulator shows whether your policies allow an action on a given ARN, and which statement decides it. You can add the bucket policy to the test too. It doesn’t cover RCPs, and results can differ from real requests when a VPC endpoint policy is involved.

5. Still stuck? Note the S3 request ID from the failed response and open a case with AWS Support.

Checklist

  1. aws sts get-caller-identity shows the role you expect.
  2. The full error message says explicit deny or no policy allows, and names the policy type.
  3. No Deny in the bucket policy matches your request, including conditions like aws:SourceVpce.
  4. No SCP, RCP, permissions boundary or session policy blocks the action.
  5. s3:ListBucket is on arn:aws:s3:::my-bucket, object actions on arn:aws:s3:::my-bucket/*.
  6. The key exists (or you have s3:ListBucket, so a missing key shows 404).
  7. For SSE-KMS: kms:GenerateDataKey to write, kms:Decrypt to read and for multipart uploads, and the key policy allows you.
  8. Cross-account: both your IAM policy and their bucket policy allow it, and the KMS key is customer managed.
  9. Object Ownership is Bucket owner enforced.
  10. Block Public Access and the VPC endpoint policy aren’t the blocker.
  11. Requester Pays buckets get --request-payer requester.

From the field

Much of my AWS work is multi-account: data platforms that collect from hundreds of sites into central buckets, and products moved over from Azure. The Access Denied errors that took longest to solve were rarely in the IAM policy everyone was staring at. They were in the bucket policy in the other account, in the KMS key policy, or in an SCP nobody on the team knew existed. So before I touch any policy now, I run aws sts get-caller-identity and read the full error message. Those two steps usually point straight at the right account and the right policy.

Keep going

Related guides:

Shorts from this guide: IAM says Allow, S3 says Access Denied, 403 for a file that doesn't exist, small uploads work, big ones fail.

Get the next one: new guides go out first on the AWS Cloud in a Minute newsletter, with a long video and Shorts on YouTube. I also run Azure Cloud in a Minute and Kubernetes in a Minute.

Sources

All from the AWS documentation:

Independent writer, not affiliated with or endorsed by Amazon Web Services.