More Info:
Amazon S3 Block Public Access feature should be enabled for your S3 buckets to restrict public access to all objects available within these buckets, including those that you upload in the future.Risk Level
CriticalAddress
SecurityCompliance Standards
- APRA CPS 234 (Australia)
- AWS Startup Security Baseline
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS AWS
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- Cloudanix Best Practice
- DPDPA
- Digital Operational Resilience Act (EU)
- Essential 8
- FedRAMP
- GDPR
- HIPAA
- HITRUST CSF
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST
- NIST CSF
- 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
- Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
Sure, here are the step-by-step instructions to remediate the misconfiguration in AWS:
- Login to your AWS Management Console.
- Navigate to the S3 service.
- Click on the bucket name you want to remediate.
- Click on the “Permissions” tab.
- Scroll down to the “Block public access” section.
- Click on the “Edit” button.
- Enable the “Block all public access” option.
- Click on the “Save changes” button.
- Repeat the above steps for all the buckets in your AWS account.
Using CLI
Using CLI
To remediate the misconfiguration “S3 Block Public Access Feature Should Be Enabled” for AWS using AWS CLI, follow these steps:This command sets the This command retrieves the current public access block configuration for your AWS account.Replace Replace
- Open the AWS CLI on your local machine or instance.
- Run the following command to enable the S3 Block Public Access feature on your AWS account:
BlockPublicAcls, IgnorePublicAcls, BlockPublicPolicy, and RestrictPublicBuckets parameters to true, which blocks public access to S3 buckets and objects.- Verify that the S3 Block Public Access feature is enabled by running the following command:
- If the S3 Block Public Access feature is not enabled, repeat step 2 to enable it.
- Once the S3 Block Public Access feature is enabled, you can verify that all S3 buckets in your AWS account have the feature enabled by running the following command:
<bucket-name> with the name of the S3 bucket you want to verify. This command retrieves the current policy status for the specified S3 bucket.- If the policy status for the S3 bucket is not compliant, update the bucket policy to ensure that public access is blocked. You can use the following policy as an example:
<bucket-name> with the name of the S3 bucket you want to update. This policy denies all public access to the specified S3 bucket.- Repeat step 5 and 6 for all S3 buckets in your AWS account to ensure that public access is blocked.
Using Python
Using Python
To remediate the “S3 Block Public Access Feature Should Be Enabled” misconfiguration in AWS using Python, follow these steps:The response should contain the following JSON object:By following these steps, you should be able to remediate the “S3 Block Public Access Feature Should Be Enabled” misconfiguration in AWS using Python.
- Install the AWS SDK for Python (Boto3) by running the following command in your command prompt or terminal:
- Import the Boto3 library and create a client for S3:
- Enable the “Block Public Access” feature for all existing and future S3 buckets by setting the BlockPublicAcls, IgnorePublicAcls, BlockPublicPolicy, and RestrictPublicBuckets parameters to True:
- Verify that the “Block Public Access” feature has been enabled by checking the response from the put_public_access_block() method:
Using Terraform
Using Terraform
terraform plan should show a new aws_s3_bucket_public_access_block.this resource being created (or its four arguments changing from false/null to true) attached to the target bucket.
