This check identifies when CloudTrail logs are stored in an S3 bucket that is publicly accessible, creating a significant security risk. CloudTrail logs contain sensitive information about API calls and activities in your AWS environment that could be exposed to unauthorized parties if stored in a public bucket. To remediate this issue, ensure your S3 bucket has its ACL set to private instead of public-read, as shown in the example below:
# This module has a public ACL but is NOT referenced by any aws_cloudtrail
# resource anywhere in this test run, so it must stay silent under
# all_cloudtrail_linked_modules' linkage check - this rule only reports
# CloudTrail's own log bucket, not every public-ACL module unconditionally.
variable"aws_access_key"{}variable"aws_secret_key"{}variable"private_key_path"{}variable"key_name"{}variable"region"{default="us-west-2"}provider"aws"{access_key=var.aws_access_keysecret_key=var.aws_secret_keyregion=var.region}module"standalone_s3_bucket"{source="terraform-aws-modules/s3-bucket/aws"version="3.7.0"versioning={enabled=true}bucket="my_bucket"acl="public-read"}