Amazon S3 Block Public Access should be turned on for the account
This check looks at the S3 Block Public Access settings for the account and its buckets. The safe setting is to have all four settings turned on, so no bucket policy or ACL can make data public by accident.
Why it matters
New S3 buckets do not allow public access by default, but AWS notes that people can later change bucket policies, access point policies or object ACLs to allow it. S3 Block Public Access settings override those policies and permissions, so one mistake in a policy does not expose data.
There are four independent settings: BlockPublicAcls, IgnorePublicAcls, BlockPublicPolicy and RestrictPublicBuckets. AWS recommends turning on all four for the account, and applying them to each bucket as well. Applied at account level they cover every region and all current and future buckets. Source: Blocking public access to your Amazon S3 storage (AWS documentation).
How to check it yourself
Console: open S3 > Block Public Access settings for this account and confirm all four options show as on. For a bucket, open the bucket and then Permissions > Block public access (bucket settings).
AWS CLI (read-only; the get commands change nothing):
aws s3control get-public-access-block --account-id <account-id>
aws s3api get-public-access-block --bucket <bucket-name>The safe result shows true for BlockPublicAcls, IgnorePublicAcls, BlockPublicPolicy and RestrictPublicBuckets. A NoSuchPublicAccessBlockConfiguration error means no setting is configured at that level. You need the s3:GetAccountPublicAccessBlock and s3:GetBucketPublicAccessBlock permissions to run these.
How to fix it
Console: in S3 > Block Public Access settings for this account choose Edit, tick Block all public access and save. Repeat per bucket if you want bucket-level settings too.
AWS CLI, which changes the account, so run it yourself after reading the next section (ConfigCobra only reports and suggests, it never changes your environment):
aws s3control put-public-access-block --account-id <account-id> \
--public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=trueRun the check commands again to confirm all four values read true. Organizations with many accounts can use an AWS Organizations policy for central control, as AWS describes in its documentation.
What changes when you fix it
Anything that relies on public access to S3 stops working, for example a static website hosted from a bucket or objects shared by a public link. AWS advises verifying that applications work without public access before applying the settings.
- Website and content owners whose buckets are meant to be public must find another way to serve them, or keep that bucket's own settings relaxed.
- Teams using cross-account bucket policies should look at
RestrictPublicBuckets, which limits access on buckets with a public policy to AWS service principals and users inside the owner's account. - Existing policies and ACLs are not rewritten; removing the setting later makes anything public in them reachable again.
Review IAM Access Analyzer for S3 first to see which buckets are public today, and tell their owners before the change.
Included in
| Benchmark | CIS ID | Profile |
|---|---|---|
| CIS Amazon Web Services Foundations v7.0.0 | 3.1.4 | Level 1 |
Check this on your AWS
ConfigCobra runs this check with every other control of the CIS Amazon Web Services Benchmarks, read-only.