Remediation
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
bucketsand then click on the S3 Bucket Name that you want to examine. - Click
Propertiestab to see in detail bucket configuration. - In the
AWS Cloud Trail data eventssection select the CloudTrail name for the recording activity. You can choose an existing Cloudtrail or create a new one by slicking theConfigure in Cloudtrailbutton or navigating to the Cloudtrail console https://console.aws.amazon.com/cloudtrail/`. - Once the Cloudtrail is selected, Select the data
Data Eventscheck box. - Select
S3from theData event typedrop down. - Select
Log all eventsfrom theLog selector templatedrop down. - Repeat steps 2 to 7 to enable object-level logging of write events for other S3 buckets.
From Command Lineβ
- To enable
object-leveldata events logging for S3 buckets within your AWS account, runput-event-selectorscommand 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>/"] }] }]'
- The command output will be
object-levelevent trail configuration. - If you want to enable it for all buckets at once then change Values parameter to
["arn:aws:s3"]in the previous command. - Repeat step 1 for each s3 bucket to update
object-levellogging of write events. - Change the AWS region by updating the
--regioncommand parameter and perform the process for other regions.