Fix it

An S3 bucket is public, or could become public by mistake

Block public access is the switch that stops one wrong policy or ACL from exposing a bucket. This is how to check it and turn it on.

AWS details read from the AWS docs on 28 November 2026. Each one links to its page.

What AWS says

  • S3 Block Public Access has four settings: BlockPublicAcls, IgnorePublicAcls, BlockPublicPolicy and RestrictPublicBuckets. Each can be applied to an access point, a bucket or an entire AWS account. AWS docs
  • Block Public Access settings override the policies and permissions that would make a bucket public. AWS docs
  • Block public access settings don't alter existing policies or ACLs. AWS docs

Find it in your account

List your buckets, then read the block public access setting of each one. AWS docs

Run this
aws s3api list-buckets --query 'Buckets[].Name' --output text
aws s3api get-public-access-block --bucket BUCKET

Fix it

  1. Turn all four settings on for the bucket, unless it is meant to be public. AWS docs
    Run this
    aws s3api put-public-access-block --bucket BUCKET --public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true
  2. Read the bucket policy and remove any statement that grants access to everyone. Block public access does not change an existing policy. AWS docs
    Run this
    aws s3api get-bucket-policy --bucket BUCKET

What OpsAgent flags

OpsAgent runs check 03 against your AWS account every night and flags:

  • High: a bucket whose policy allows public access while block public access is off.
  • Medium: a bucket with block public access off, which one wrong policy or ACL would make public.
  • Critical: a database with a public endpoint, or a public database or disk snapshot. These are in the 15-minute urgent set; buckets are checked in the nightly scan.

What OpsAgent does not do here

  • It never opens or lists your objects, so it cannot tell you what a public bucket holds. Its read role is denied data reads.
  • It never changes a bucket setting. It connects read-only; you run the commands above.

Get your ops teammate.

Start a 14-day free trial. Card required, cancel any time.

Start free trial