Free security runbook · Amazon S3

The bucket that answers: find public S3 access before a scanner does

A bucket rarely starts public. It starts with a policy added for a launch page, an ACL written by old tooling, or an account-level guardrail turned off so one bucket could serve a website. The useful question is not "is there a policy" but "can an anonymous request read this object right now, from outside our network".

This page is free and defensive only. It covers how to inventory your own buckets, how to prove reachability instead of inferring it, and the order in which to close the gap without breaking a distribution or a static site.

Scope: reviewed from the AWS S3 documentation, no live reproduction
Verified against the Amazon S3 Block Public Access, bucket policy status, ACL, Object Ownership and Access Analyzer documentation, and the S3 server access log format, on 2026-12-03. Command output below is the expected shape, not a capture from a live account. Run every command against buckets you own.
Read the state

Four facts before any change

Four switches, two levels

Block Public Access has four settings — BlockPublicAcls, IgnorePublicAcls, BlockPublicPolicy and RestrictPublicBuckets. Each can be set per bucket and per account. A bucket policy cannot loosen the account-level setting.

Policy is not reachability

GetBucketPolicyStatus reports whether the bucket policy is public. A block setting can still override it, so read the policy, the blocks and an anonymous request together before you conclude anything.

ACLs outlive the policy review

Buckets created before Object Ownership moved to BucketOwnerEnforced may still carry grants to the AllUsers group. A clean bucket policy does not clear an ACL.

Anonymous requests leave a mark

Server access logs and CloudTrail data events record the request, but an anonymous read has no meaningful identity. Filter on an empty requester rather than on a user name.

Detect

Audit your own buckets, in this order

Command or viewWhat it tells you
aws s3api list-buckets --query 'Buckets[].Name' --output textThe inventory. The bucket you forgot is usually in a second account, so repeat with every profile you operate.
aws s3api get-public-access-block --bucket "$B"The bucket-level blocks. NoSuchPublicAccessBlockConfiguration means none are set here; the account level may still protect the bucket.
aws s3api get-bucket-policy-status --bucket "$B"PolicyStatus.IsPublic. True means the policy grants public access; it does not by itself prove an anonymous request succeeds.
aws s3api get-bucket-acl --bucket "$B"Grants to AllUsers or AuthenticatedUsers. Any such grant is a public path that a policy review misses.
aws s3api get-bucket-ownership-controls --bucket "$B"The object ownership setting. BucketOwnerEnforced disables ACLs; any other value means ACLs still matter.
aws s3api get-bucket-website --bucket "$B"Static website hosting. It needs public read, and it is often left on long after the site moved to CloudFront.
curl -sI "https://$B.s3.amazonaws.com/$K"An unauthenticated request from outside your network. A 200 or 206 is reachability; a 403 is a denial. Do this only against your own objects.
aws accessanalyzer list-findings --analyzer-arn "$ARN"External-access findings for S3 buckets, including public and cross-account access. Treat it as a second opinion, not the only check.
aws s3api get-object-acl --bucket "$B" --key "$K"Object-level grants on a sampled key, only where ACLs are still enabled.
Failure modes

Seven ways a bucket becomes readable

#Failure modeWhat you seeWhat to do
1A policy with a wildcard principal and s3:GetObjectIsPublic: true; the statement was added for one launch asset and never narrowed.Replace the principal with the distribution or role that needs it; do not just delete the statement and break a live page.
2A legacy ACL granting AllUsersThe policy is clean and the ACL still shows a public read grant; Access Analyzer may not flag the ACL path the same way.Switch Object Ownership to BucketOwnerEnforced after checking which tools still call PutObjectAcl.
3Account-level Block Public Access is offEvery new bucket starts one policy away from public, and no guardrail catches the next one.Turn on the account-level settings after inventorying static sites and distributions, because they will break public origins.
4Static website hosting still enabledA second, HTTP-only endpoint answers with directory-style paths that the API endpoint does not serve.Move the site to CloudFront with an origin access control, then disable website hosting.
5CloudFront origin left publicThe distribution still returns 200, so nobody notices that the bucket is also directly readable.Use origin access control, then restrict the bucket policy to that distribution's service principal.
6A "public" policy that is actually constrainedIsPublic: true, but the statement requires a VPC endpoint or a source IP range and anonymous internet requests get 403.Prove it with an anonymous request before removing anything; a true finding and a noisy one need different fixes.
7A long-lived presigned URLNo policy change and no public ACL, but the object is readable until the signature expires, including from a page or a log it leaked into.Cap expiry, avoid putting signed URLs in client code, and rotate the credentials that signed them if they leaked.
Close

Order matters more than the switch

StepActionWhy this order
1Snapshot the policy, ACL, blocks and website configurationVersioning does not cover configuration. You need the exact previous state to roll back a broken page.
2Prove reachability from outsideAn alert on a public policy is not the same as an object the internet can read; do not change production on an inference.
3Fix the distribution path firstIf CloudFront still points at the bucket by origin domain name, turning on blocks breaks the site before it fixes the exposure.
4Enable the bucket-level blocksBlockPublicPolicy and IgnorePublicAcls stop new public grants even if a policy is added again.
5Enable the account-level blocksThe durable guardrail. Do it after step 3, and expect any remaining public website to break loudly.
6Rotate what the objects exposedPublic JavaScript and configuration files leak keys and tokens; closing the bucket does not un-leak them.
Verify

Four drills that prove the closure

Anonymous read

From a host outside the VPC and without credentials, request a known key. Confirm 403 after the change, and confirm the same key still loads through the distribution.

Policy status

Re-read GetBucketPolicyStatus and the ACL. A public policy left in place but overridden by a block is a latent finding, not a fixed one.

Account guardrail

Create a throwaway bucket, attach a public-read policy, and confirm the account-level block rejects it. Delete the bucket afterwards.

Access Analyzer

Confirm the finding moves to resolved, and that no new finding appeared for the distribution or the logs bucket.

FAQ

Questions from the security review

Is a public bucket always a breach?

No. A bucket can be intentionally public, for example a static site or a public dataset. The finding is that the public path is unowned, undocumented or broader than the objects it was meant to serve. Record the intent, then narrow the scope.

Why does the console say private while curl still gets the object?

Check which endpoint you requested. The static website endpoint and the REST endpoint behave differently, and a CDN in front can serve a cached copy after the bucket is closed. Test the exact URL an outsider would use.

Can we just turn on all four account-level blocks?

It is the right end state, but it will break public website endpoints and any distribution that still reads the bucket as a public origin. Fix those paths first, then enable the blocks during a change window you can watch.

Do server access logs prove who read a public object?

They prove the request happened, the time, the source address and the object. An anonymous request has no authenticated identity, so logs answer "what was taken" far better than "who took it".

Sources

Primary sources

Closing an exposure is a change window

The paid runbooks cover the same shape of problem on other platforms: a control that looks enabled, a path that bypasses it, and a rollback that has to be rehearsed before the change.

This page is free, no checkout. Paid runbooks are $9.99 each and covered by the 7-day refund policy at /runbooks/refund.