CloudTrail log bucket public access needs review

Remove public permissions from audit-log storage while preserving log delivery.

Description

An effective public READ bucket ACL lets anyone list object names. Check the bucket policy and each log object’s permissions to determine who can read the contents.

Potential impact

A public listing exposes object names. If the objects also allow public reads, they can disclose account activity and API calls.

Remediation

Remove public ACLs and public bucket-policy grants. Keep S3 Block Public Access enabled. Before disabling ACLs, move required delivery and read access into policies. Restrict CloudTrail writes with an aws:SourceArn condition for your trail. Verify that new logs arrive and only approved auditors can read the objects they need.

Examples

The examples change public-read to private on an existing ACL-enabled bucket. New buckets disable ACLs by default. Use a unique name and manage delivery and access through the bucket policy.

Before

hcl
resource "aws_cloudtrail" "cloudtrail" {
  name           = "tf-trail-foobar"
  s3_bucket_name = aws_s3_bucket.log_bucket.id
}

resource "aws_s3_bucket" "log_bucket" {
  bucket = "my-tf-test-bucket"
  acl    = "public-read"
}

After

hcl
resource "aws_cloudtrail" "cloudtrail" {
  name           = "tf-trail-foobar"
  s3_bucket_name = aws_s3_bucket.log_bucket.id
}

resource "aws_s3_bucket" "log_bucket" {
  bucket = "my-tf-test-bucket"
  acl    = "private"
}

References