Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AFT feature "CloudTrail data events" does not properly exclude Log Archive buckets #513

Open
nApucco opened this issue Nov 28, 2024 · 0 comments
Labels
bug Something isn't working pending investigation Issue needs further investigation

Comments

@nApucco
Copy link

nApucco commented Nov 28, 2024

AFT Version:

Bug Description
The advanced event selector "No Log Archive Buckets" of the organizational trail "aws-aft-CustomizationsCloudTrail" is configured in a way, that does not exclude data events from all AFT and Control Tower S3 buckets in the Log Archive account.

The selector uses an incorrect operator for this data event type and tries to match the S3 bucket ARN with RegEx which is not allowed.

To Reproduce

  1. Go to the Log Archive account and open the "aws-aft-logs-..." bucket.
  2. Navigate to the CloudTrail logs of the Log Archive account.
    (e.g. AWSLogs/<org-id>/<log-archive-account-id>/CloudTrail/eu-central-1/2024/11/28/)
  3. Download and unzip any of the logs.
  4. Search for "PutObject" and observe all the data events of CloudTrail writing objects into AFT or CT S3 buckets.

Expected behavior
The CloudTrail should not collect any data events from the 4 AFT and Control Tower S3 buckets in the Log Archive account.

Proposed fix/solution

The AWS documentation states, that advanced event selectors that filter S3 objects based on the resources.ARN should use StartsWith or NotStartsWith operators instead of Equals/NotEquals and use the bucket ARN with a trailing slash.
(https://docs.aws.amazon.com/awscloudtrail/latest/userguide/filtering-data-events.html#filtering-data-events-resourcearn)

Switching the operators from NotEquals to NotStartsWith and removing the * at the end of each log bucket ARN fixes the issue in the advanced event selector.

(Manually tested such a fix in my organization: CloudTrail no longer logs data events from AFT/CT S3 buckets in Log Archive, but keeps collecting data events from the rest of the organization.)

@nApucco nApucco added bug Something isn't working pending investigation Issue needs further investigation labels Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending investigation Issue needs further investigation
Projects
None yet
Development

No branches or pull requests

1 participant