- 
                Notifications
    
You must be signed in to change notification settings  - Fork 604
 
[Rule Tunings] AWS Multiple API Calls ESQL rules #5238
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
base: main
Are you sure you want to change the base?
Conversation
AWS EC2 Multi-Region DescribeInstances API Calls Over 2,000 alerts in the last 24 hours. This is a very noisy rule, by design it is alerting on quite normal behavior. There is not much in-the-wild threat behavior that justifies keeping this rule as a standalone alert. As a threat indicator, this is best used as a hunting rule or in correlation with another rule, for example: (GetCallerIdentity new terms + multi region DescribeInstances by same principal) or (Multiple Discovery API calls + multi region DescribeInstances by same principal) or (multi region DescribeInstances + snapshot/AMI activity by same principal). However, on its own it’s not adding much value over the noise. - I’m keeping this as ESQL rule but converting it to a BBR - keeping more fields for further context - Changing investigation guide to be more relevant for hunting/correlation rule AWS Discovery API Calls via CLI from a Single Resource This rule is alerting as expected with low telemetry. It has to remain an ESQL rule as no other rule types can truncate the time window to 10 sec looking for a threshold of unique API calls coming from a single user. - Keeping as ESQL rule - Reduced execution window - Keeping more fields for further context - Adding highlighted fields - Updated Investigation guide
          
Rule: Tuning - GuidelinesThese guidelines serve as a reminder set of considerations when tuning an existing rule. Documentation and Context
 Rule Metadata Checks
 Testing and Validation
  | 
    
| tags = [ | ||
| "Domain: Cloud", | ||
| "Data Source: AWS", | ||
| "Data Source: AWS EC2", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add Cloudtrail as a data source to be consistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm yea I should do that with all the AWS rules, it's something I'll look at doing later.
| 
               | 
          ||
| [rule.investigation_fields] | ||
| field_names = [ | ||
| "aws.cloudtrail.user_identity.arn", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May want to double check these. We do a keep and then stats which will table only by what we aggregate on so the alert doc may not have some of the original AWS fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oop nice catch I need to go back in and add these fields to the stats with VALUES()
Pull Request
Issue link(s):
Summary - What I changed
AWS EC2 Multi-Region DescribeInstances API Calls
Over 2,000 alerts in the last 24 hours. This is a very noisy rule, by design it is alerting on quite normal behavior. There is not much in-the-wild threat behavior that justifies keeping this rule as a standalone alert. As a threat indicator, this is best used as a hunting rule or in correlation with another rule, for example: (GetCallerIdentity new terms + multi region DescribeInstances by same principal) or (Multiple Discovery API calls + multi region DescribeInstances by same principal) or (multi region DescribeInstances + snapshot/AMI activity by same principal). However, on its own it’s not adding much value over the noise.
AWS Discovery API Calls via CLI from a Single Resource
This rule is alerting as expected with low telemetry. It has to remain an ESQL rule as no other rule types can truncate the time window to 10 sec looking for a threshold of unique API calls coming from a single user.
How To Test
Plenty of data in our test stack to run queries against. Script for the AWS Discovery API Calls rule. It is very extensive in the API calls it makes, I wanted this script to be a bit more realistic and trigger across many different services.
Screenshots for AWS Discovery API Calls via CLI from a Single Resource
Expected Alert with very little context
New Working Query with additional context
New Expected Alert with additional context