This rule ensures that all S3 buckets are logging S3 data events in CloudTrail for enhanced security.
Rule | All S3 buckets should log S3 data events in CloudTrail |
Framework | NIST 800-53 Revision 5 |
Severity | ✔ Medium |
Rule Description:
All S3 buckets should have logging enabled for S3 data events in CloudTrail to meet the requirements of NIST 800-53 Revision 5.
This rule aims to ensure that all data-related activities performed on S3 buckets are centrally logged and auditable in order to enhance security and compliance controls.
Troubleshooting Steps:
Necessary Code:
No code is required for this rule. Instead, you need to use AWS Management Console and AWS CLI to enable CloudTrail and S3 logging.
Step-by-step Remediation:
Using AWS Management Console:
Please follow these steps to enable CloudTrail and S3 logging for NIST 800-53 Revision 5 compliance:
Using AWS CLI:
Alternatively, you can use the AWS CLI to enable CloudTrail and S3 logging for NIST 800-53 Revision 5 compliance:
Open the AWS CLI or terminal.
Run the following command to create a trail with S3 logging:
$ aws cloudtrail create-trail --name my-trail --s3-bucket-name my-bucket --include-global-service-events --is-multi-region-trail --enable-log-file-validation --enable-cloud-watch-logs-exports 'CloudWatchLogsLogGroupArn=my-log-group-arn'
Adjust the values for
--name
, --s3-bucket-name
, and --enable-cloud-watch-logs-exports
as per your requirements.To enable logging of specific S3 buckets, run the following command:
$ aws cloudtrail put-event-selectors --trail-name my-trail --event-selectors '[{"ReadWriteType": "All", "IncludeManagementEvents": true, "DataResources": [{"Type": "AWS::S3::Object", "Values": ["arn:aws:s3:::my-bucket"]}]}]'
Replace
my-trail
with the appropriate trail name and my-bucket
with the desired S3 bucket.Review other settings such as storage options, log file validation, and encryption using separate CLI commands as per your requirements.
Note: Ensure that you have the necessary permissions and AWS CLI is properly configured with the correct AWS credentials.
By following these steps, you will enable CloudTrail and S3 logging for all relevant S3 buckets, meeting the requirements of NIST 800-53 Revision 5.