Skip to main content

Triage and Remediation

Remediation

Using Console

To remediate the “S3 Bucket Should Not Allow WRITE_ACP Access to Authenticated Users” misconfiguration in AWS, you can follow these steps using the AWS console:
  1. Log in to the AWS Management Console.
  2. Navigate to the S3 service.
  3. Click on the name of the bucket that you want to remediate.
  4. Click on the “Permissions” tab.
  5. Click on the “Access control list (ACL)” button.
  6. Under the “Grantee” column, find the row that has “Authenticated Users”.
  7. In the “Permission” column, find the “WRITE_ACP” permission.
  8. Click on the “x” button to remove the “WRITE_ACP” permission for “Authenticated Users”.
  9. Click on the “Save” button to save the changes.
  10. Verify that the “Authenticated Users” group no longer has the “WRITE_ACP” permission by checking the “Access control list (ACL)” again.
  11. Repeat these steps for any other S3 buckets that have the same misconfiguration.
Note: You can also use AWS CLI or AWS SDKs to remediate this misconfiguration.

To remediate the misconfiguration “S3 Bucket Should Not Allow WRITE_ACP Access to Authenticated Users” for AWS using AWS CLI, follow these steps:
  1. Open the AWS CLI on your local machine.
  2. Run the following command to get a list of all S3 buckets in your AWS account:
  3. Identify the S3 bucket that has WRITE_ACP access granted to authenticated users.
  4. Run the following command to revoke WRITE_ACP access for authenticated users:
    Replace “bucket-name” with the name of the S3 bucket that you want to remediate.
  5. Verify that WRITE_ACP access for authenticated users has been revoked by running the following command:
    Replace “bucket-name” with the name of the S3 bucket that you want to remediate.
  6. Repeat the above steps for all S3 buckets that have WRITE_ACP access granted to authenticated users.
By following these steps, you can remediate the misconfiguration “S3 Bucket Should Not Allow WRITE_ACP Access to Authenticated Users” for AWS using AWS CLI.
To remediate the misconfiguration of allowing WRITE_ACP access to authenticated users in an AWS S3 bucket using Python, follow these steps:
  1. Create an AWS S3 client using the AWS SDK for Python (Boto3).
  2. Get the bucket policy using the get_bucket_policy() method of the S3 client.
  3. Parse the JSON policy to identify the statement that allows WRITE_ACP access to authenticated users.
  4. Remove the identified statement from the policy.
  5. Update the bucket policy using the put_bucket_policy() method of the S3 client.
Here’s the Python code to remediate the misconfiguration:
This code will remove the statement that allows WRITE_ACP access to authenticated users from the S3 bucket policy.
Both changes are in-place on the existing bucket (no bucket replacement), but they can immediately impact who has access.Verification with terraform plan:
  • For Option 1, plan should show creation/update of aws_s3_bucket_acl.this with acl = "private" and removal of any prior ACL configuration.
  • For Option 2, plan should show creation/update of aws_s3_bucket_ownership_controls.this with object_ownership = "BucketOwnerEnforced".