Information
S3 object-level API operations, such as GetObject, DeleteObject, and PutObject, are referred to as data events. By default, CloudTrail trails do not log data events, so it is recommended to enable object-level logging for S3 buckets.
Enabling object-level logging will help you meet data compliance requirements within your organization, perform comprehensive security analyses, monitor specific patterns of user behavior in your AWS account, or take immediate actions on any object-level API activity within your S3 buckets using Amazon CloudWatch Events.
NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance.
Solution
From Console:
- Login to the AWS Management Console and navigate to the S3 dashboard at https://console.aws.amazon.com/s3/
- In the left navigation panel, click buckets and then click the name of the S3 bucket you want to examine.
- Click the Properties tab to see the bucket configuration in detail.
- In the AWS CloudTrail data events section, select the trail name for recording activity. You can choose an existing trail or create a new one by clicking the Configure in CloudTrail button or navigating to the
CloudTrail console
.
- Once the trail is selected, select the Data Events check box.
- Select S3 from the Data event type drop-down.
- Select Log all events from the Log selector template drop-down.
- Repeat steps 2-7 to enable object-level logging of write events for other S3 buckets.
From Command Line:
- To enable object-level data events logging for S3 buckets within your AWS account, run the put-event-selectors command using the name of the trail that you want to reconfigure as identifier:
aws cloudtrail put-event-selectors --region <region-name> --trail-name <trail-name> --event-selectors '[{ "ReadWriteType": "WriteOnly", "IncludeManagementEvents":true, "DataResources": [{ "Type": "AWS::S3::Object", "Values": ["arn:aws:s3:::<s3-bucket-name>/"] }] }]' <xhtml:ol start="2"> - The command output will be object-level event trail configuration.
- If you want to enable it for all buckets at once, change the Values parameter to ["arn:aws:s3"] in the previous command.
- Repeat step 1 for each s3 bucket to update object-level logging of write events.
- Change the AWS region by updating the --region command parameter, and perform the process for the other regions.
Impact:
Enabling logging for these object-level events may significantly increase the number of events logged and may incur additional costs.