This rule ensures that the S3 bucket used for storing CloudTrail logs is not publicly accessible.
Rule | Ensure the S3 bucket used to store CloudTrail logs is not publicly accessible |
Framework | cis_v130 |
Severity | ✔ Critical |
Ensure the S3 Bucket Used to Store CloudTrail Logs is Not Publicly Accessible (CIS v1.3.0 Compliance)
The AWS CloudTrail service provides a record of actions taken by a user, role, or an AWS service. CloudTrail logs are a critical component of security and governance best practices. To ensure the protection of this sensitive information, it is vital to ensure that the S3 bucket used for storing CloudTrail logs is not publicly accessible.
AWS Compliance Requirement
The Center for Internet Security (CIS) AWS Foundations Benchmark version 1.3.0 requires that S3 buckets used for storing CloudTrail logs must not be publicly accessible. This is to reduce the risk of unauthorized data exposure.
Troubleshooting Steps
If you suspect that your S3 bucket may be publicly accessible, perform the following checks:
Review Bucket Policy
Inspect the Access Control List (ACL)
Verify Bucket Public Access Settings
Check CloudTrail Configuration
Remediation Steps
If you find that your S3 bucket is publicly accessible, follow these steps to remedy the situation:
Modify Bucket Policy to Restrict Public Access
CLI command to remove a public access policy (replace 'YOUR-BUCKET-NAME' with your actual bucket name):
aws s3api put-bucket-policy --bucket YOUR-BUCKET-NAME --policy "{}"
Update the Access Control List (ACL)
Adjust Block Public Access Settings
CLI command to block all public access:
aws s3api put-public-access-block \ --bucket YOUR-BUCKET-NAME \ --public-access-block-configuration "BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true"
Confirm the Changes
By following these steps, you can ensure that your S3 bucket used for storing CloudTrail logs is not publicly accessible, maintaining compliance with the CIS AWS Foundations Benchmark v1.3.0.