This rule ensures proper logging of S3 data events in CloudTrail for all S3 buckets.
Rule | All S3 buckets should log S3 data events in CloudTrail |
Framework | NIST Cybersecurity Framework (CSF) v1.1 |
Severity | ✔ Medium |
Rule Description
The rule requires that all Amazon Simple Storage Service (S3) buckets in an AWS account have logging enabled for S3 data events in AWS CloudTrail. This requirement is consistent with the NIST Cybersecurity Framework (CSF) version 1.
Troubleshooting Steps (if applicable)
If the logging for S3 data events in CloudTrail is not enabled for any S3 buckets, you can follow these troubleshooting steps:
Verify the AWS account and permissions:
Confirm the CloudTrail configuration:
Check S3 bucket permissions:
Verify the bucket policies:
Necessary Code
No code is required for troubleshooting. However, to enable logging for S3 data events in CloudTrail, you can use the AWS Command Line Interface (CLI) or AWS Management Console.
Step-by-Step Guide for Remediation
To enable logging for S3 data events in CloudTrail, follow these steps:
Using AWS Management Console:
Using AWS CLI:
Install and configure the AWS CLI if you haven't already.
Open a terminal or command prompt.
Run the following command to enable logging for S3 data events in CloudTrail:
aws cloudtrail put-event-selectors --trail-name <TRAIL_NAME> --event-selectors file://<JSON_FILE_PATH>
Replace
<TRAIL_NAME>
with the name of the CloudTrail trail and <JSON_FILE_PATH>
with the path to a JSON file containing the event selectors configuration. The JSON file should include the necessary configuration for S3 data events.Example JSON file contents:
[
{
"ReadWriteType": "All",
"IncludeManagementEvents": false,
"DataResources": [
{
"Type": "AWS::S3::Object",
"Values": []
}
]
}
]
Save the file with the desired configuration, and provide the path to this file in the command.
Once the changes are saved in either the console or CLI, CloudTrail will start logging the specified S3 data events for all relevant S3 buckets in the AWS account. Ensure that the settings are properly propagated and validated in CloudTrail.
By following these steps, you will enable logging for S3 data events in CloudTrail, ensuring compliance with the NIST Cybersecurity Framework (CSF) version 1.