# 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.

```json
{
  "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.

- Allows 81 actions (s3:Get*, s3:List*) on arn:aws:s3:::amzn-s3-demo-bucket, arn:aws:s3:::amzn-s3-demo-bucket/*.

Checks:
- No flags.

The two wildcards include actions that read bucket policies, ACLs and settings, not only object data.

## Least privilege rewrite

```json
{
  "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.

- Allows 1 action (s3:ListBucket) on arn:aws:s3:::amzn-s3-demo-bucket.
- Allows 1 action (s3:GetObject) on arn:aws:s3:::amzn-s3-demo-bucket/*.

Checks:
- No flags.

- [Paste it into the workbench](/)
- [Every S3 action and its access level](/actions/s3/)

## Related pages

- [IAM policy example: read and write one S3 bucket](/examples/s3-read-write-one-bucket/)
- [IAM policy example: give each user an S3 home folder](/examples/s3-home-folder-by-username/)
- [IAM policy example: deny S3 requests without TLS](/examples/s3-deny-non-tls-requests/)
- [All of them](/examples/)

## Sources

- Amazon S3 User Guide: identity-based policy examples: https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-policies-s3.html (read 16 Nov 2026)
- IAM User Guide: S3 read and write access to one bucket: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_s3_rw-bucket.html (read 16 Nov 2026)
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026): https://docs.aws.amazon.com/service-authorization/latest/reference/service-reference.html (read 16 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://iampolicygenerator.com/examples/s3-read-one-bucket/

This site is not affiliated with Amazon Web Services. AWS service and product names are used only to describe AWS services.
