CloudTrail trail is not configured to log data events for S3 buckets Affecting CloudTrail service in AWS


Severity

0.0
medium
0
10
Severity Framework
Snyk CCSS
Rule category
Logging/ Configuration

Is your environment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
Frameworks
CIS-ControlsHIPAAISO-27001NIST-800-53PCI-DSSSOC-2
  • Snyk IDSNYK-CC-00210
  • creditSnyk Research Team

Description

Data events provide visibility into the resource operations performed on or within a resource, including S3 object-level API activity. By default, trails do not log data events. Note that data events are often high-volume activities.

How to fix?

Set the event_selector.data_resource.type attribute to AWS::S3::Object, and event_selector.data_resource.values to arn:aws:s3:::<bucket name>/.

Example Configuration

resource "aws_cloudtrail" "valid_trail" {
  name = "valid_trail"
  s3_bucket_name = "${aws_s3_bucket.ct_bucket.id}"

  event_selector {
    data_resource {
      type = "AWS::S3::Object"
      values = ["${aws_s3_bucket.important_bucket.arn}/"]
    }
  }
}