HIGH
Source
Trivy/CSPM
CSPM ID
s3-bucket-all-users-acl
ID
AVD-AWS-0086

S3 Access block should block public ACL

S3 buckets should block public ACLs on buckets and any objects they contain. By blocking, PUTs with fail if the object has any public ACL a.

Impact

PUT calls with public ACLs specified can make objects public

Follow the appropriate remediation steps below to resolve the issue.

Enable blocking any PUT calls with a public ACL specified

1
2
3
4
5
6
7
8
9
Resources:
  GoodExample:
    Properties:
      PublicAccessBlockConfiguration:
        BlockPublicAcls: true
        BlockPublicPolicy: true
        IgnorePublicAcls: true
        RestrictPublicBuckets: true
    Type: AWS::S3::Bucket
  1. Log in to the AWS Management Console.

  2. Select the “Services” option and search for S3. Step

  3. Scroll down the left navigation panel and choose “Buckets”.Step

  4. Select the “Bucket” that needs to be verified and click on its identifier(name) from the “Bucket name” column.Step

  5. Click on the “Permissions” tab on the top menu. Step

  6. Check the “Access Control List” option under “Permissions” and scroll down the configuration page and check the “Block public access (bucket settings)”. If its status is “Off” then public access to your S3 bucket and objects is open. Step

  7. Scroll down to “Access control list (ACL)” and verify if the bucket allows “Everyone (public access)”.Step

  8. If public List, Read or Write is Enabled in step 6 or 7 then disable by clicking “Edit” in “Block public access (bucket settings)” and select “Block all public access” and click “Save changes” button. Step

  9. In the “Edit Block public access (bucket settings)” confirmation box type “confirm” in the text box and click “Confirm” button.Step

  10. Scroll down to “Access control list (ACL)” and click “Edit”. On the “Edit access control list (ACL)” page uncheck all checkboxes other than “Bucket owner (your AWS account)” and click on “Save changes” button.Step

  11. Repeat steps number 4 - 10 to disable global write, delete, or read ACL permissions in other S3 buckets.

Enable blocking any PUT calls with a public ACL specified

1
2
3
4
5
6
7
8
9
resource "aws_s3_bucket" "good_example" {
  bucket = "mybucket"
}

resource "aws_s3_bucket_public_access_block" "good_example" {
  bucket = aws_s3_bucket.good_example.id
  block_public_acls = true
}