This rule ensures blocking S3 public access at account level.
Rule | S3 public access should be blocked at account level |
Framework | NIST 800-53 Revision 5 |
Severity | ✔ Medium |
Rule Description
The rule dictates that public access to Amazon S3 buckets should be blocked at the account level in compliance with the NIST 800-53 Revision 5 security framework. This rule ensures that sensitive data stored in S3 buckets remains protected and is only accessible to authorized individuals.
Troubleshooting Steps (if applicable)
Necessary Codes (if applicable)
To implement this rule, you may need to use the AWS Command Line Interface (AWS CLI) or AWS CloudFormation templates.
Step-by-Step Guide for Remediation
Option 1: Using AWS CLI
Install AWS CLI: If you don't have AWS CLI installed, follow the instructions in the AWS CLI User Guide to install it.
List all S3 buckets in your account:
aws s3 ls
Identify the S3 bucket with public access enabled.
Review the bucket ACL:
aws s3api get-bucket-acl --bucket BUCKET_NAME
Replace
BUCKET_NAME
with the name of the bucket identified in step 3.Remove public access using bucket ACLs:
aws s3api put-bucket-acl --bucket BUCKET_NAME --acl private
Replace
BUCKET_NAME
with the name of the bucket identified in step 3.Review the bucket policy:
aws s3api get-bucket-policy --bucket BUCKET_NAME
Replace
BUCKET_NAME
with the name of the bucket identified in step 3.Remove public access using bucket policies:
aws s3api delete-bucket-policy --bucket BUCKET_NAME
Replace
BUCKET_NAME
with the name of the bucket identified in step 3.Repeat steps 3-7 for all S3 buckets in your account.
Option 2: Using AWS CloudFormation
Create an AWS CloudFormation template to define the desired bucket configurations. Ensure that the desired state blocks public access.
Deploy the CloudFormation stack using the AWS Management Console, AWS CLI, or AWS SDK.
Monitor the CloudFormation deployment to ensure successful provisioning of resources.
Validate the S3 buckets to confirm public access is blocked.
Repeat steps 1-4 for any additional S3 buckets in your account.
By following the above steps, you will block public access to your S3 buckets at the account level, aligning with the requirements of NIST 800-53 Revision 5.