Description
BlockPublicAcls rejects requests to set public ACLs on an S3 bucket or its objects. New buckets disable ACLs by default. On an existing bucket, check Object Ownership and the account’s Block Public Access settings.
Potential impact
Where public grants take effect, a bucket ACL can expose object listings or allow unwanted uploads. A public read grant on an object can expose its contents.
Remediation
For a private bucket, set BlockPublicAcls: true and IgnorePublicAcls: true under PublicAccessBlockConfiguration. Remove unnecessary public grants and check the bucket policy and other blocking options. Before disabling ACLs, move required application permissions to policies and test access.
Examples
Before
Resources:
Bucket1:
Type: AWS::S3::Bucket
Properties:
PublicAccessBlockConfiguration:
BlockPublicAcls: false
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
After
Resources:
Bucket1:
Type: AWS::S3::Bucket
Properties:
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
Both templates ignore public ACL grants. The second also rejects attempts to set a new public ACL.