This rule ensures S3 buckets do not allow public read access, critical for foundational security.
Rule | S3 buckets should prohibit public read access |
Framework | AWS Foundational Security Best Practices |
Severity | ✔ Critical |
Rule Description:
The rule ensures that S3 buckets in an AWS environment are configured to prohibit public read access. This is in compliance with the AWS Foundational Security Best Practices, which aim to enhance the security posture of AWS resources.
Policy Details:
The policy can be summarized as follows:
Troubleshooting Steps:
If there is an issue with compliance or if the S3 bucket has public read access, follow these troubleshooting steps:
Necessary Codes:
No specific code is required to adhere to this policy. However, the following AWS CLI commands can be used for troubleshooting and remediation if necessary.
To check if an S3 bucket has public read access using the AWS CLI:
aws s3api get-bucket-acl --bucket <bucket-name>
To update the bucket's ACL to remove public read access:
aws s3api put-bucket-acl --bucket <bucket-name> --acl private
To check the bucket policy associated with the S3 bucket using the AWS CLI:
aws s3api get-bucket-policy --bucket <bucket-name>
To update the bucket policy and deny public read access:
aws s3api put-bucket-policy --bucket <bucket-name> --policy file://bucket_policy.json
Note: Replace
<bucket-name>
with the actual name of the S3 bucket.Remediation Steps:
Follow these steps to remediate an S3 bucket with public read access:
aws s3api put-bucket-acl --bucket <bucket-name> --acl private
By following these steps, the S3 bucket should be remediated to comply with the AWS Foundational Security Best Practices.