rql to bring back account_names that are not running a 'named' CloudTrail

Reply
L1 Bithead

rql to bring back account_names that are not running a 'named' CloudTrail

Hello team.

 

I have a named CloudTrail which every account must have.  aws-landing-zone-logs-us-east-1

 

Some accounts have additional CloudTrails in addition to the above for there own purposes.

 

I want an alert that tells me if 'any' account does not have a CloudTrail called aws-landing-zone-logs-us-east-1 but IMPORTANTLY ignoring any other CloudTrail they may already have.

 

The problem is that the below is alerting even though an account has aws-landing-zone-logs-us-east-1 because it is alerting for the additional CloudTrails also on that account.

 

config where api.name='aws-cloudtrail-describe-trails' AND cloud.type = 'aws' AND json.rule = "(s3BucketName!= aws-landing-zone-logs-us-east-1)"

 

Your help welcome and can't figure how to do it. 

 

L2 Linker

Re: rql to bring back account_names that are not running a 'named' CloudTrail

RQL is built for looking for resources that exist and have a certain configuration.  There isn't a good way to detect for resources that should exist without also alerting on other matching resources.  Using a script or a SIEM to further filter out the resources you don't care about is also an option.

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!