Skip to main content

More Info:

AWS S3 buckets should not allow public READ access in order to protect against unauthorized access.

Risk Level

Medium

Address

Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • AWS Startup Security Baseline
  • AWS Well Architected Framework
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • Essential 8
  • HIPAA
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • PCI
  • Reserve Bank of India (RBI) Cyber Security Framework
  • Reserve Bank of India (RBI) Master Direction – Information Technology Framework
  • SOC2
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

Sure, I can help you with that. Here are the step by step instructions to remediate the issue “S3 Buckets Should Not Allow Public READ Access” in AWS:
  1. Log in to the AWS Management Console.
  2. Go to the S3 service.
  3. Select the bucket that has public READ access.
  4. Click on the Permissions tab.
  5. Under the Public access settings, click on Edit.
  6. Uncheck the box that says “List objects” and “View object permissions” for “Everyone”, “Authenticated users” and “Log delivery group”.
  7. Click on Save changes.
After following these steps, your S3 bucket will no longer allow public READ access.

To remediate the misconfiguration of S3 buckets allowing public READ access in AWS using AWS CLI, you can follow the below steps:
  1. Open the AWS CLI on your local machine and run the following command to list all the S3 buckets in your AWS account:
  2. Identify the S3 bucket(s) that have public READ access.
  3. Run the following command to remove public READ access from the identified S3 bucket(s):
    Replace <bucket-name> with the name of the identified S3 bucket.
  4. Verify that public READ access has been removed from the S3 bucket(s) by running the following command:
    Replace <bucket-name> with the name of the identified S3 bucket.
  5. Repeat steps 3 and 4 for all the S3 buckets that have public READ access.
  6. Once all the S3 buckets have been remediated, ensure that you have a process in place to regularly monitor your S3 buckets for public READ access and remediate any misconfigurations promptly.
To remediate the issue of S3 Buckets allowing public READ access in AWS using python, follow these steps:
  1. Install the AWS SDK for Python (boto3) using pip:
  1. Create an AWS S3 client using boto3:
  1. List all S3 buckets in your AWS account using the list_buckets() method:
  1. For each S3 bucket, check if it has any public READ access by using the get_bucket_acl() method:
  1. If public READ access is found, remove it by using the put_bucket_acl() method:
  1. Repeat steps 4-5 for all S3 buckets in your AWS account.
By following these steps, you can remediate the issue of S3 Buckets allowing public READ access in AWS using python.
Substitute:
  • YOUR_BUCKET_NAME with the actual S3 bucket name.
  • PRIVATE_BUCKET / PRIVATE_BUCKET_BPA with your resource names, if different.
This enables all four Block Public Access settings on the bucket, matching the put-public-access-block CLI remediation. It does not force replacement of the bucket, but it will immediately block all current and future public access to the bucket; ensure no workloads require public reads.Verification: terraform plan should show creation (or update) of aws_s3_bucket_public_access_block.PRIVATE_BUCKET_BPA with all four attributes set to true.

Additional Reading: