IAM policy example: read one S3 bucket, with a least privilege rewrite
Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.
Allows a principal to list the keys in one S3 bucket named amzn-s3-demo-bucket and to read every object in it. The Get and List wildcards expand to 63 and 18 actions in the service authorization reference, which covers more than reading objects. The rewrite names two actions.
Open the workbench ยท All examples
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadBucket",
"Effect": "Allow",
"Action": [
"s3:Get*",
"s3:List*"
],
"Resource": [
"arn:aws:s3:::amzn-s3-demo-bucket",
"arn:aws:s3:::amzn-s3-demo-bucket/*"
]
}
]
}
What it allows
- Allows every S3 action that starts with Get or List, on the bucket and on all objects in it.
- No condition limits the caller, the network or the object key.
What it allows
Allow 81 actions (s3:Get*, s3:List*) on arn:aws:s3:::amzn-s3-demo-bucket, arn:aws:s3:::amzn-s3-demo-bucket/*.
Action or pattern Actions Access levels s3:Get*63 Read 63 s3:List*18 List 18
Checks
No flags from the six checks.
The two wildcards include actions that read bucket policies, ACLs and settings, not only object data.
Least privilege rewrite
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListBucket",
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::amzn-s3-demo-bucket"
},
{
"Sid": "GetObjects",
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::amzn-s3-demo-bucket/*"
}
]
}
The rewrite keeps ListBucket on the bucket and GetObject on its objects. It drops the Get and List wildcards, so the caller can no longer read bucket policy or ACL settings.
What it allows
Allow 1 action (s3:ListBucket) on arn:aws:s3:::amzn-s3-demo-bucket.
Action or pattern Actions Access levels s3:ListBucket1 List 1 Allow 1 action (s3:GetObject) on arn:aws:s3:::amzn-s3-demo-bucket/*.
Action or pattern Actions Access levels s3:GetObject1 Read 1
Checks
No flags from the six checks.
Related pages
Sources
- Amazon S3 User Guide: identity-based policy examples, read 16 Nov 2026
- IAM User Guide: S3 read and write access to one bucket, read 16 Nov 2026
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026
Last reviewed 16 Nov 2026.