S3 Bucket Policy Generator

Write a correct bucket policy JSON for the usual requirements without hand-editing ARNs.

Use the tool

Why this tool exists

Enter the bucket name and choose a case. The policy uses the standard 2012-10-17 version, correct resource ARNs for the bucket and its objects, and the right condition keys (aws:SecureTransport, AWS:SourceArn, aws:SourceIp). Inputs are validated: bucket naming rules, a CloudFront distribution ARN, a 12-digit account ID or an IPv4 CIDR.

Public read also requires turning off Block Public Access for the bucket, and Deny statements with broad principals can lock you out of your own bucket, so test on a scratch bucket. Prefer CloudFront with origin access control to public buckets.

No data is sent anywhere: the work happens in your browser, so you can use it offline once the page has loaded.

How to use it

  1. Enter the bucket name.
  2. Choose a case and fill the extra value.
  3. Copy the JSON into the bucket policy editor.
  4. Use the IAM policy simulator to test.

Frequently asked questions

Is public read safe?

Only for content that is meant to be public. Many data leaks come from public buckets.

Why deny HTTP?

To make sure all access uses TLS.

Does it support multiple statements?

It writes one statement per case; combine statements by hand.

Is my data sent anywhere?

No. Everything is processed in your browser, and the page makes no network requests with your input.