Skip to content
IAM Policy Generator

IAM policy example: list S3 buckets in the console, with a least privilege rewrite

Allows a principal to see the list of buckets in the account and each bucket's Region, which the S3 console needs on its first page. Nothing in it reads objects. The original grants s3:List* on all resources, which is wider than the console page needs.

Open the workbench ยท All examples

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ListAllBuckets",
      "Effect": "Allow",
      "Action": [
        "s3:List*",
        "s3:GetBucketLocation"
      ],
      "Resource": "*"
    }
  ]
}

What it allows

  • Allows every S3 list action on every resource, plus the bucket location lookup.

What it allows

  1. Allow 19 actions (s3:List*, s3:GetBucketLocation) on every resource.

    Action or patternActionsAccess levels
    s3:List*18List 18
    s3:GetBucketLocation1Read 1

Checks

No flags from the six checks.

The wildcard s3:List* covers 18 actions and applies to all resources, which includes object listings in every bucket.

Least privilege rewrite

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ListAllBuckets",
      "Effect": "Allow",
      "Action": [
        "s3:ListAllMyBuckets",
        "s3:GetBucketLocation"
      ],
      "Resource": "*"
    }
  ]
}

The rewrite names the two actions the console bucket list uses. Object listings in individual buckets now need their own statement.

What it allows

  1. Allow 2 actions (s3:ListAllMyBuckets, s3:GetBucketLocation) on every resource.

    Action or patternActionsAccess levels
    s3:ListAllMyBuckets1List 1
    s3:GetBucketLocation1Read 1

Checks

No flags from the six checks.

Sources

  1. Amazon S3 User Guide: identity-based policy examples, read 16 Nov 2026
  2. AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026

Last reviewed 16 Nov 2026.