Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
- Open the AWS S3 Console.
- Navigate to the specific S3 bucket for which you want to enforce secure transport.
- Click on the “Permissions” tab.
- Scroll down to the “Bucket policy” section.
- Edit the bucket policy to enforce the use of HTTPS.
YOUR_BUCKET_NAME with the name of your S3 bucket.Using CLI
Using CLI
YOUR_BUCKET_NAME with the name of your S3 bucket.Using Python
Using Python
YOUR_BUCKET_NAME, YOUR_ACCESS_KEY, YOUR_SECRET_KEY, and update the region with your desired region in the Python script. Run the script, and it will enforce the use of HTTPS for the specified S3 bucket. Make sure to install the boto3 library if you haven’t already:Using Terraform
Using Terraform
put-bucket-policy call; it updates the existing policy in place (no bucket replacement), but it will overwrite any previous policy unless you merge other required statements into the aws_iam_policy_document.Verification: terraform plan should show an aws_s3_bucket_policy resource being created or updated with a Deny statement on s3:* for the bucket and all objects when aws:SecureTransport is false.
