Skip to main content

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration “S3 Bucket Should Not Allow Public WRITE_ACP Access” for AWS using the AWS console, please follow the below steps:
  1. Log in to your AWS console.
  2. Navigate to S3 service.
  3. Select the bucket that has public WRITE_ACP access.
  4. Click on the “Permissions” tab.
  5. Scroll down to “Access Control List (ACL)” and click on it.
  6. Look for any entries that have the “Grantee” set to “All Users” or “Authenticated Users”.
  7. If you find any such entries, select them and click on the “Revoke” button to remove the public WRITE_ACP access.
  8. Click on the “Save” button to save the changes.
Once you have completed the above steps, your S3 bucket will no longer have public WRITE_ACP access and will be remediated.

To remediate the misconfiguration “S3 Bucket Should Not Allow Public WRITE_ACP Access” for AWS using AWS CLI, you can follow these steps:
  1. Open the AWS CLI on your local machine or EC2 instance.
  2. Identify the S3 bucket that is allowing public WRITE_ACP access. You can use the following command to list all the S3 buckets in your AWS account:
  1. Once you have identified the bucket, you can use the following command to update the bucket policy to remove public WRITE_ACP access:
Replace BUCKET_NAME with the name of the S3 bucket that you want to update.
  1. Verify that the bucket policy has been updated successfully by running the following command:
Replace BUCKET_NAME with the name of the S3 bucket that you updated in step 3.
  1. Check if the misconfiguration has been remediated by running a security scan or audit on your AWS account.
By following these steps, you can remediate the misconfiguration “S3 Bucket Should Not Allow Public WRITE_ACP Access” for AWS using AWS CLI.
To remediate the issue of S3 Bucket allowing public WRITE_ACP access in AWS using Python, you can follow the below steps:
  1. Install the AWS SDK for Python (boto3) using the following command:
  1. Create a boto3 S3 client object using the following code:
  1. Get the bucket policy using the get_bucket_policy method of the S3 client object:
  1. Check if the bucket policy allows public WRITE_ACP access. You can use the following code to check this:
  1. If the bucket policy allows public WRITE_ACP access, you can remove it using the put_bucket_acl method of the S3 client object. You can use the following code to remove the public WRITE_ACP access:
This will set the bucket ACL to private and remove the public WRITE_ACP access.
This enables all four S3 Block Public Access settings on the bucket, matching the put-public-access-block CLI fix and effectively preventing public WRITE_ACP via ACLs; it may impact workloads that rely on any public access, so review before applying.This change does not force replacement of the bucket, but it will update its access behavior.To verify, terraform plan should show creation (or update) of aws_s3_bucket_public_access_block.MY_BUCKET_BPA with all four attributes set to true and no planned - (destroy/replace) for the bucket itself.