This rule ensures that S3 buckets restrict public write access to enhance security measures.
Rule | S3 buckets should prohibit public write access |
Framework | FedRAMP Low Revision 4 |
Severity | ✔ High |
Rule Description: S3 buckets should prohibit public write access for FedRAMP Low Revision 4
This rule ensures that S3 buckets have the necessary permissions configured to prevent public write access in compliance with the FedRAMP Low security standard, Revision 4.
Troubleshooting Steps (if necessary):
Necessary Code (if necessary):
If the S3 bucket policy, IAM policies, or ACLs need to be modified, you can use the following code snippets as reference:
Bucket Policy:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "DenyPublicWriteAccess", "Effect": "Deny", "Principal": "*", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::your-bucket/*", "Condition": { "Bool": { "aws:SecureTransport": "false" } } } ] }
IAM Policy:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "DenyPublicWriteAccess", "Effect": "Deny", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::your-bucket/*", "Condition": { "Bool": { "aws:SecureTransport": "false" } } } ] }
Remediation Steps:
Follow the steps below to remediate the S3 bucket and prohibit public write access:
AWS Management Console:
AWS CLI:
aws s3api put-bucket-policy --bucket your-bucket --policy file://bucket-policy.json
Replace
your-bucket
with the name of your target S3 bucket and ensure you have the necessary permissions to modify the bucket policy.aws s3api put-bucket-acl --bucket your-bucket --acl public-read-write --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers
Again, replace
your-bucket
with the name of your target S3 bucket and ensure you have the necessary permissions.Note: It is recommended to test these changes in a non-production environment before applying them to live/production environments.