This rule ensures that S3 buckets restrict public read access to maintain data security.
Rule | S3 buckets should prohibit public read access |
Framework | NIST 800-171 Revision 2 |
Severity | ✔ Medium |
Rule Description
This rule requires that all S3 buckets should have public read access disabled in order to comply with NIST 800-171 Revision 2 security standards. Allowing public read access to S3 buckets could potentially expose sensitive data to unauthorized users, which poses a security risk.
Troubleshooting Steps
If public read access is enabled for an S3 bucket, you need to follow these troubleshooting steps to rectify the issue:
Necessary Codes
To prohibit public read access for an S3 bucket, you can use the following example code to define a bucket policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyPublicRead",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": [
"arn:aws:s3:::your-bucket-name/*"
],
"Condition": {
"StringEquals": {
"aws:SourceVpce": "vpce-your-vpce-id"
}
}
}
]
}
Please replace "your-bucket-name" with the actual name of your S3 bucket and "vpce-your-vpce-id" with the Amazon VPC endpoint ID to restrict access to your VPC only.
Step-by-Step Guide for Remediation
To remediate the S3 bucket and prohibit public read access, follow these steps:
By following these steps and updating the bucket policy with the provided code, public read access will be prohibited for the S3 buckets, aligning with the security requirements specified in NIST 800-171 Revision 2.