How the permissions are found
Every AWS API call is authorized by one or more IAM actions, and they are not always named like the call: aws lambda invoke needs lambda:InvokeFunction, CompleteMultipartUpload needs s3:PutObject, and RunInstances can also need iam:PassRole and ec2:CreateTags. The finder reads this from the AWS Service Reference, the machine-readable version of the Service Authorization Reference, which your browser loads straight from AWS: the current list of actions, resources and ARN formats for over 400 services.
- Always needed - the action that authorizes the operation itself.
- Needed with certain parameters - other actions AWS lists for the operation:
s3:GetObjectVersionwhen a version ID is given,iam:PassRolewhen an instance gets a role. Tick them to add them to the policy. - Resources - the ARN formats of the action, filled with the names in the command (bucket, key, table, function, queue) and the account and Region you enter; anything not given is
*.
The high-level aws s3 commands - cp, sync, mv, rm, ls - make several API calls each; the finder knows which. sync, for example, lists both buckets, so it needs s3:ListBucket on the bucket and s3:GetObject or s3:PutObject on the objects - two statements, because the bucket and its objects have different ARNs.
Reading an AccessDenied error
Most AWS services say in the error which policy denied the request, in the form User: ARN is not authorized to perform: ACTION on resource: ARN because .... The end of the message decides where the fix goes:
| The message ends with | Where to fix it |
|---|---|
| because no identity-based policy allows | Add an Allow to a policy of the user or role |
| because no resource-based policy allows | Add the principal to the bucket, key, secret or queue policy |
| because no role trust policy allows | Add the principal to the trust policy of the role being assumed |
| because no permissions boundary allows | Allow the action in the boundary set on the user or role |
| because no session policy allows | Create the session without the session policy, or with the action in it |
| because no service control policy allows | The organization's management account has to allow it in an SCP |
| because no VPC endpoint policy allows | Allow the action in the policy of the VPC endpoint |
| with an explicit deny in ... | Find and narrow the Deny statement - no Allow can override it |
An assumed-role session such as arn:aws:sts::111122223333:assumed-role/app-role/i-0abc123 is the role arn:aws:iam::111122223333:role/app-role: fix the role's policies, and name the role in a resource or trust policy. Amazon S3's plain Access Denied without details usually means a bucket policy, Block Public Access, a KMS key policy or object ownership; check the bucket's policy and encryption first.
Frequently asked questions
Is the command or the error sent anywhere?
No. Your browser downloads AWS's public permission list of the service from AWS and matches the text against it; nothing you enter is uploaded, processed on a server or stored - AWS only sees which service's list was downloaded. The page only counts that the finder was used, with what kind of input and for which service, never the text.
Is the generated policy least privilege?
It contains only the actions the call needs, on the resources the call names. Where the command gives no name, the ARN has a * - replace it with the real name to narrow the policy further. Conditions (tags, encryption, source IP) are yours to add.
Why does a command not show up?
AWS does not yet list the permissions of every operation in the Service Reference, and some AWS CLI commands (aws cloudformation deploy, aws eks get-token) are built from several API calls. For these, the Service Authorization Reference lists the actions per service.
References
Simplified AWS service information for programmatic access
Troubleshoot access denied error messages
Policy evaluation logic