3.9 Ensure that Object-level logging for read events is enabled for S3 bucket

Information

S3 object-level API operations such as GetObject, DeleteObject, and PutObject are called data events. By default, CloudTrail trails don't log data events and so it is recommended to enable Object-level logging for S3 buckets.

Rationale:

Enabling object-level logging will help you meet data compliance requirements within your organization, perform comprehensive security analysis, monitor specific patterns of user behavior in your AWS account or take immediate actions on any object-level API activity using Amazon CloudWatch Events.

Impact:

Enabling logging for these object level events may significantly increase the number of events logged and may incur additional cost.

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 S3 dashboard at https://console.aws.amazon.com/s3/

In the left navigation panel, click buckets and then click on the S3 Bucket Name that you want to examine.

Click Properties tab to see in detail bucket configuration.

In the AWS Cloud Trail data events' section select the CloudTrail name for the recording activity. You can choose an existing Cloudtrail or create a new one by slicking the Configure in Cloudtrailbutton or navigating to the Cloudtrail console linkhttps://console.aws.amazon.com/cloudtrail/'

Once the Cloudtrail is selected, Select the data 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 to 5 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 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': 'ReadOnly', 'IncludeManagementEvents':true, 'DataResources': [{ 'Type': 'AWS::S3::Object', 'Values': ['arn:aws:s3:::<s3-bucket-name>/'] }] }]'

The command output will be object-level event trail configuration.

If you want to enable it for all buckets at once then change Values parameter to ['arn:aws:s3'] in command given above.

Repeat step 1 for each s3 bucket to update object-level logging of read events.

Change the AWS region by updating the --region command parameter and perform the process for other regions.

See Also

https://workbench.cisecurity.org/benchmarks/14207