Description
S3 object-level API operations such as GetObject, DeleteObject, and PutObject are called data events. By default, CloudTrail trails do not log data events, so it is recommended to enable object-level logging for S3 buckets.
Rationaleβ
Enabling object-level logging helps you meet data compliance requirements, perform comprehensive security analysis, monitor specific patterns of user behavior in your AWS account, and take immediate actions on object-level API activity within your S3 buckets 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.
Auditβ
From Consoleβ
-
Login to the AWS Management Console and navigate to CloudTrail dashboard at https://console.aws.amazon.com/cloudtrail/
-
In the left panel, click
Trailsand then click on the CloudTrail Name that you want to examine. -
Review
General details. -
Confirm that
Multi-region trailis set toYes. -
Scroll down to
Data eventsand confirm the configuration:- If
advanced event selectorsis being used, it should read:
Data Events:S3
Log selector template
Log all eventsIf
basic events selectorsis being used it should read:Data events: S3
Bucket Name: All current and future S3 buckets
Write: Enabled - If
-
Repeat steps 2-5 to verify that each trail has multi-region enabled and is configured to log data events. If a trail does not have multi-region enabled and data event logging configured, refer to the remediation steps.
From Command Lineβ
-
Run
list-trailscommand to list all trails:aws cloudtrail list-trails -
The command output will be a list of trails:
"TrailARN": "arn:aws:cloudtrail::<account#>:trail/",
"Name": "",
"HomeRegion": "" -
Next run
get-trailcommand to determine whether a trail is a multi-region trail:aws cloudtrail get-trail --name {{trail-name}} --region {{region-name}} -
The command output should include:
"IsMultiRegionTrail": true -
Next run
get-event-selectorscommand using theNameof the trail and theregionreturned in step 2 to determine if data event logging is configured:aws cloudtrail get-event-selectors --region {{region-name}} --trail-name {{trail-name}} --query EventSelectors[*].DataResources[] -
The command output should be an array that contains the configuration of the AWS resource(S3 bucket) defined for the Data events selector:
"Type": "AWS::S3::Object",
"Values": [
"arn:aws:s3"
] -
If the
get-event-selectorscommand returns an empty array, data events are not included in the trail's logging configuration; therefore, object-level API operations performed on S3 buckets within your AWS account are not being recorded. -
Repeat steps 1-7 to verify that each trail has multi-region enabled and is configured to log data events. If a trail does not have multi-region enabled and data event logging configured, refer to the remediation steps.