Nothing stops a deployment faster than an Access Denied error. You run a command you have run a hundred times, or you open an object you know exists, and AWS answers with a flat 403. No stack trace, no helpful hint, just a refusal. The same message can come from half a dozen causes: a missing permission, an explicit deny buried in a service control policy, a KMS key that refuses to decrypt, a bucket policy that conflicts with Block Public Access, or an EKS cluster that does not recognize your identity.
This guide works through Access Denied errors in the order that finds the cause: how AWS evaluates a request, how to read the enhanced 403 message S3 now returns, and the most common failure points: identity policies and the resource ARN mistake, bucket policies and Block Public Access, KMS encryption keys, cross-account access and organization policies, and EKS authentication. It ends with a ten-minute step-by-step checklist. If you are new to IAM, read our AWS IAM tutorial for beginners first. It covers users, roles, groups, and managed policies, the building blocks this article assumes you already understand.
How AWS Evaluates a Request: Explicit Deny Always Wins
Every request to AWS goes through the same evaluation logic. When a principal such as an IAM user, a role, or a federated identity makes a request, AWS gathers every policy that could apply: identity-based policies, resource-based policies, permission boundaries, session policies, service control policies from AWS Organizations, and resource control policies. It evaluates them together under a strict order.
The first rule is that an explicit Deny always wins. If any applicable policy contains an explicit Deny for the requested action and resource, the request is denied immediately, no matter how many Allow statements exist elsewhere. It does not matter that your identity policy allows s3:GetObject or that the bucket policy allows your account. One explicit Deny anywhere in the chain overrides all of it. Deny is the emergency brake, and AWS treats it as absolute.
The second rule is that, with no explicit Deny, an explicit Allow is required. AWS starts from an implicit deny: nothing is allowed unless a policy says so. This is the most common cause of Access Denied errors in practice. People add a policy for the action they think they need, but the action they actually need is a different one, the resource ARN is wrong, or the policy is attached to the wrong principal. The error message gives no hint about which of those three things went wrong.
The third rule is that organization-level policies act as filters on everything below them. A service control policy, or SCP, sets the maximum permissions for an account in an organization: even if an identity policy in the account allows an action, an SCP that does not allow it will block the request. Resource control policies, or RCPs, work the same way from the resource side. Neither grants permissions; they only limit what other policies can grant, so adding more Allow statements inside an account will never overcome an SCP or RCP that blocks the action. Permission boundaries and session policies work the same way: they never grant access and can only narrow what is already allowed. When you find a policy that allows the action, do not stop there: ask whether any other policy in the chain denies it or filters it out.
Read the Enhanced 403 Message First
For years, S3 returned the same unhelpful Access Denied message for every 403, and the only way to find the cause was to check every policy by hand. That has changed: S3 now includes enhanced context in 403 errors for requests within the same account or the same organization, and that context is the fastest starting point you have. Instead of guessing, read the error first.
The enhanced message tells you the policy type and the reason for the denial. For an explicit deny, it also gives you the ARN of the policy that contains the deny, so you can go straight to the offending policy. This matters because explicit denies are the hardest cause to find by inspection: the denying policy may sit on a group you forgot the user belongs to, or an SCP applied at the organizational unit level that nobody remembers setting.
To see the enhanced message, reproduce the failing request with the AWS CLI and read the full error output; the console often shows a shortened version. Run the command that failed with the same credentials, and read the error text in full before you change anything.
aws s3 cp s3://my-app-bucket/reports/january.csv ./january.csv
aws s3api get-object --bucket my-app-bucket --key reports/january.csv ./january.csv
aws sts get-caller-identity
The third command is the one people skip, and it saves the most time: it tells you exactly which identity is making the request, the account, the user or role name, and the ARN. Access Denied errors frequently turn out to be an identity problem rather than a permission problem: you are running the command with a different profile than you think, a role assumption expired, or a CI pipeline is using old credentials. Also note the action and the resource: listing a bucket requires s3:ListBucket on the bucket, downloading requires s3:GetObject on the object, and uploading requires s3:PutObject. Granting one does not grant the others. Finally, without s3:ListBucket permission, requesting a missing key returns 403 instead of 404, by design: returning a 404 for a missing key and a 403 for a denied key would let anyone probe a bucket to learn which keys exist. If you get a 403 and are not sure the object exists, check with a principal that has ListBucket permission first.
Identity Policies and the /* ARN Gotcha
The most common Access Denied cause in S3 is a wrong resource ARN in an identity policy. S3 has two levels of resource, and each action targets only one. Bucket-level actions such as s3:ListBucket target the bucket ARN, arn:aws:s3:::my-app-bucket. Object-level actions such as s3:GetObject, s3:PutObject, and s3:DeleteObject target the object ARN, arn:aws:s3:::my-app-bucket/*. Attach the wrong ARN to the wrong action and the policy looks correct at a glance and fails every time.
The classic mistake is granting s3:GetObject on the bucket ARN without the /* suffix. The statement is syntactically valid and AWS will happily save it, but it will never allow a download, because s3:GetObject never applies to a bucket ARN. The reverse mistake is just as common: granting s3:ListBucket on the object ARN, which never allows a listing. When you see an Access Denied error on an action that a policy appears to allow, check the ARN first. A correct minimal policy for a user who needs to list a bucket and download objects has two statements, one for each action with its matching ARN. Both are needed, and neither can substitute for the other.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::my-app-bucket"
},
{
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-app-bucket/*"
}
]
}
Beyond the ARN, check where the policy is attached. An identity policy only works if it is attached to the principal making the request, to a group that principal belongs to, or to a role the principal has assumed. A policy attached to the wrong user, a group the user left, or a role the application no longer assumes will not help, no matter how correct its contents are. List the policies on the actual caller identity you confirmed with sts get-caller-identity, not the identity you assume is calling.
aws iam list-attached-user-policies --user-name deploy-user
aws iam list-groups-for-user --user-name deploy-user
aws iam list-attached-role-policies --role-name app-role
Finally, test with the IAM Policy Simulator before you edit a policy in production: enter the principal, the action, and the resource, and it tells you whether the request is allowed and which policy decided it. If a policy clearly allows an action and the simulator still says denied, look for a permission boundary or a session policy on the principal. Our AWS tutorial for beginners walks through roles and policies from the start, including how boundaries and session policies fit in.
Bucket Policies and Block Public Access
When the identity policy is correct and access is still denied, look at the bucket policy. It is a resource-based policy attached to the bucket itself, and it controls who can access the bucket and its objects, including principals from other accounts. For same-account access, either the identity policy or the bucket policy allowing the request is enough. For cross-account access, both sides must allow it: the identity policy in the requesting account and the bucket policy in the bucket account. If either side is missing, the request is denied.
Bucket policies have their own version of the ARN gotcha. A statement that allows s3:GetObject must use the object ARN with the /* suffix, and one that allows s3:ListBucket must use the bucket ARN without it. Check each statement’s actions match its resources before you look anywhere else.
Block Public Access is the other common culprit at the bucket level: four settings, BlockPublicAcls, IgnorePublicAcls, BlockPublicPolicy, and RestrictPublicBuckets, applied at the bucket or the account level, which block public access even when a bucket policy explicitly allows it. They are on by default for new buckets, which is why a bucket policy copied from a tutorial can fail silently on a new bucket. Check the settings for the bucket and the account, because account-level settings apply to every bucket and can override a bucket-level change.
aws s3api get-public-access-block --bucket my-app-bucket
aws s3api get-bucket-policy --bucket my-app-bucket
aws s3api get-bucket-acl --bucket my-app-bucket
Access control lists, or ACLs, are the oldest access mechanism in S3, and they still cause Access Denied errors in older buckets. An object uploaded with an ACL that grants access only to a different account, or without the bucket-owner-full-control setting on a cross-account upload, can be unreadable by the bucket owner. AWS now recommends disabling ACLs entirely in favor of bucket policies, through the BucketOwnerEnforced setting for Object Ownership. There is one more trap: conditions in the bucket policy. A condition requiring requests from a specific VPC endpoint denies every request from outside it, and a condition requiring secure transport denies any request over plain HTTP. A condition on a Deny statement is especially dangerous, because it denies the request whenever the condition is true.
KMS Encryption Keys: The Hidden Deny
Some Access Denied errors have nothing to do with S3 permissions at all: the object is encrypted with a KMS key, and the caller does not have permission to use that key. The S3 policy allows the download, the bucket policy allows it, and the request still fails, because decrypting the object requires kms:Decrypt, and the key policy does not grant it. The error says Access Denied and gives no hint that encryption is involved.
KMS keys have their own key policies, separate from IAM policies, and both must allow use of the key. An IAM policy can grant kms:Decrypt, but only if the key policy allows the account or principal to use the key. If the key policy grants access only to the account root and nobody has added the IAM user or role, no IAM policy will fix the problem. The key policy is the gatekeeper, and IAM policies cannot open a gate it has closed.
The fix is to add the principal to the key policy, or to add a statement allowing the account to use the key and then grant kms:Decrypt through IAM. The statement below allows a specific role to use the key. Replace the role ARN with the actual role or user that needs access, and keep the key policy as narrow as you can: a key that everyone can use is a key that protects nothing.
{
"Sid": "Allow app role to use the key",
"Effect": "Allow",
"Principal": {"AWS": "arn:aws:iam::123456789012:role/app-role"},
"Action": ["kms:Encrypt", "kms:Decrypt", "kms:GenerateDataKey"],
"Resource": "*"
}
Check the encryption settings on the bucket and on the object: a bucket default encrypts every new object with a specific KMS key, and an object uploaded with a different key needs permission for that key instead. If a pipeline started failing after someone changed the bucket default encryption key, the KMS key is the first suspect. Use the commands below to see which key an object is encrypted with, then check the key policy for that key.
aws s3api head-object --bucket my-app-bucket --key reports/january.csv
aws kms describe-key --key-id arn:aws:kms:us-east-1:123456789012:key/abc123
aws kms get-key-policy --key-id abc123 --policy-name default
Cross-account KMS keys add another layer: the caller needs kms:Decrypt through IAM in their own account, and the key policy in the key account allowing their account or role. Both sides must allow it, just like cross-account S3 access. Also check the direction: uploading with a specified KMS key needs kms:Encrypt and kms:GenerateDataKey on that key, not just s3:PutObject on the bucket, while downloading needs kms:Decrypt. If the object is encrypted with an AWS managed key rather than a customer managed key, the key policy is managed by AWS and cannot be edited, so the fix must come from the IAM side.
Cross-Account Access, SCPs and RCPs
Cross-account access fails more often than same-account access, because it requires two sides to agree. For a user in account A to read an object in a bucket owned by account B, the identity policy in account A must allow s3:GetObject, and the bucket policy in account B must allow account A or the specific role. If the bucket policy allows the whole account, any principal in it with the matching identity permission can access the bucket. If it allows only a specific role, only that role can, and every other principal in account A will be denied even though their identity policies allow it.
The cleanest pattern is a role in the bucket account rather than a bucket policy naming external principals. The external user assumes that role, which has an identity policy allowing access to the bucket. The trust policy controls who can assume the role; the identity policy controls what the role can do. This keeps all the permissions in one account, which is much easier to audit than a bucket policy naming principals in many accounts. If you inherited a bucket policy that names external accounts, check it against the actual callers: each principal in a named account still needs its own identity policy to allow the action.
Service control policies are the next layer to check when access inside an organization fails for no apparent reason. An SCP applies to an entire account or organizational unit and filters its maximum permissions. If an SCP does not allow s3:GetObject, no policy inside the account can grant it. SCPs are managed in AWS Organizations, often set by a central team and forgotten by the teams inside the accounts. The symptom is distinctive: the same policy works in a standalone account but fails in an organization account, or works for one account and not another in a different organizational unit. When you see that pattern, check the policies on the account and its parent organizational units.
aws organizations list-policies-for-target --target-id 123456789012 --filter SERVICE_CONTROL_POLICY
aws organizations list-targets-for-policy --policy-id p-abc123
Resource control policies, or RCPs, are the newer counterpart to SCPs, filtering access from the resource side. An RCP can block access based on conditions such as the caller, the network, or the encryption of the resource. Like SCPs, RCPs never grant permissions; they only limit what other policies can grant. An RCP may block access to S3 resources from principals outside the organization, a common guardrail, and a legitimate cross-account request from outside will be denied by it. There is one more trap: the bucket owner and the object owner can be different accounts. When a user in account A uploads an object to a bucket in account B without granting the bucket owner control, the object belongs to account A, and the bucket owner cannot read it even with a bucket policy that allows them to. Enabling BucketOwnerEnforced for Object Ownership makes the bucket owner the owner of every object uploaded to it.
EKS kubectl Errors and a Step-by-Step Checklist
EKS produces its own flavor of Access Denied: the error looks like an IAM problem, but the fix is often inside Kubernetes. When kubectl says the user is unauthorized, first check which identity kubectl is using. EKS authenticates API requests with IAM, and the cluster maps IAM identities to Kubernetes users and groups through the aws-auth ConfigMap or EKS access entries. If your identity is in neither mapping, the cluster will reject you no matter what IAM permissions you have.
The commands below show the IAM identity behind your current kubeconfig context and the access entry for a role. If you assumed a role to access the cluster, the role ARN must be the one in the access entry, not your IAM user ARN: role assumption changes your identity, and an access entry for the user will not match a request made as the role.
aws sts get-caller-identity
aws eks describe-access-entry --cluster-name my-cluster --principal-arn arn:aws:iam::123456789012:role/dev-role
kubectl auth can-i list pods --namespace default
EKS access entries are the modern way to grant cluster access, replacing the aws-auth ConfigMap for most use cases. An access entry links an IAM principal to a Kubernetes group or to an access policy such as AmazonEKSViewPolicy or AmazonEKSAdminPolicy, and it can be scoped to a namespace. Check that the entry exists, grants the level of access you need, and that its scope matches your namespace. A view-only entry denies a kubectl apply, and a namespace-scoped entry denies requests in other namespaces. Both look like a generic unauthorized error, so check the scope as well as the existence of the entry.
If the cluster still uses the aws-auth ConfigMap, check it directly. It lives in kube-system and maps IAM roles to Kubernetes groups. A common mistake is editing the ConfigMap and breaking its YAML formatting, which the cluster then cannot parse, denying everyone who depends on it. Another is mapping a role to a group with no RoleBinding in the namespace. The mapping only connects the IAM identity to a Kubernetes group; the group still needs a RoleBinding or ClusterRoleBinding that grants it permissions. Without a binding, the identity is authenticated but authorized for nothing.
kubectl get configmap aws-auth -n kube-system -o yaml
kubectl get rolebindings,clusterrolebindings -A | grep dev-team
Token expiry is the other EKS cause that looks like a permission problem. The token kubectl uses is short-lived, usually fifteen minutes, generated from your IAM credentials by aws eks get-token in your kubeconfig. If your IAM credentials have expired, the generated token will be rejected, so refresh your credentials and run kubectl again rather than changing any policy. Intermittent failures in long-running scripts or CI jobs point to the same cause. Finally, check whether the cluster endpoint is reachable: a private endpoint cluster rejects connections from outside its VPC, and the error can look like an authentication failure. Run kubectl from inside the VPC. Our AWS VPC explained guide covers the subnets and endpoints that decide whether a cluster is reachable, and the AWS guide to troubleshooting 403 errors in S3 is worth keeping open for S3 denials.
Here is the checklist to run whenever an Access Denied error appears, stopping at the first step that explains the failure. First, confirm the caller identity with sts get-caller-identity and reproduce the failing command. Second, read the full enhanced 403 message. Third, check the identity policy, action, and resource ARN. Fourth, check the bucket policy, Block Public Access, and any conditions. Fifth, check KMS: confirm the key policy and IAM policy allow the needed action. Sixth, check SCPs and RCPs. Seventh, for cross-account requests, confirm both sides allow the action. Eighth, for EKS, confirm the access entry or aws-auth mapping and the RoleBinding. Ninth, test with the Policy Simulator before and after any change, and confirm the fix with the original command.
Frequently Asked Questions
Why does AWS return 403 instead of 404 for a missing S3 object?
Without s3:ListBucket permission, S3 returns 403 for a missing key instead of 404, by design. A different error for missing keys than for denied keys would let anyone probe a bucket to learn which keys exist. If you get a 403 and are not sure the object exists, check with a principal that has ListBucket permission first.
What is the difference between an explicit deny and an implicit deny?
An explicit deny comes from a Deny statement in an applicable policy, and it overrides every Allow. An implicit deny means no applicable policy allows the request, so AWS denies it by default. An explicit deny means a policy is actively blocking you, and the enhanced 403 message names the policy ARN. An implicit deny means a permission is missing: add the right Allow with the right action and resource ARN.
Can a bucket policy alone grant cross-account access?
No, not on its own. Cross-account access requires both sides to allow it: the bucket policy must allow the external account or principal, and the identity policy in the requesting account must allow the action. If either side is missing, the request is denied. The exception is when the external principal assumes a role in the bucket account, in which case that role policy controls access.
Why can I list a bucket but not download objects from it?
Listing and downloading are different actions with different resource ARNs. Listing requires s3:ListBucket on the bucket ARN, arn:aws:s3:::bucket, while downloading requires s3:GetObject on the object ARN, arn:aws:s3:::bucket/*. A policy that grants only one allows only that operation. Check that your policy has two statements, one per action with its matching ARN, and check whether a KMS key policy is also blocking decryption.
Why does kubectl say unauthorized when my IAM policy allows EKS?
IAM permissions and Kubernetes authorization are two separate steps. IAM authenticates you to the cluster, but the cluster then checks whether your identity is mapped to a Kubernetes group through an access entry or the aws-auth ConfigMap, and whether that group has a RoleBinding for the action. If the mapping or the binding is missing, or the access entry is scoped to a different namespace, kubectl will report unauthorized even though your IAM policy is correct. The AWS policy evaluation logic documentation explains the IAM side of this evaluation, and the cluster side is checked with kubectl auth can-i and by inspecting the access entries.
Conclusion
Access Denied errors feel random because the same message hides so many causes, but they are not random at all. Every 403 follows the same evaluation logic: an explicit Deny wins, an Allow is required, organization policies filter everything below them, and both sides must agree for cross-account access. Once you know that logic, debugging becomes systematic. Read the enhanced 403 message, confirm the caller identity, check the identity policy and its ARNs, then work outward through the bucket policy, Block Public Access, KMS keys, SCPs and RCPs, and finally the EKS access mapping if the error is on a cluster.
Test before and after every change: reproduce the exact failing command, use the Policy Simulator to predict the result of a policy edit, and confirm the fix with the original command rather than a different one that happens to work. Keep your policies narrow, keep the bucket and object ARNs straight, and remember that a KMS key policy and an organization policy can both deny a request every other policy allows. Work through the checklist in order, and the next Access Denied error will take minutes instead of an afternoon.



