Detection: Detect Spike in AWS Security Hub Alerts for EC2 Instance

Description

The following analytic identifies a spike in the number of AWS Security Hub alerts for an EC2 instance within a 4-hour interval. It leverages AWS Security Hub findings data, calculating the average and standard deviation of alerts to detect anomalies. This activity is significant for a SOC as a sudden increase in alerts may indicate potential security incidents or misconfigurations requiring immediate attention. If confirmed malicious, this could signify an ongoing attack, leading to unauthorized access, data exfiltration, or disruption of services on the affected EC2 instance.

1`aws_securityhub_finding` "Resources{}.Type"=AWSEC2Instance 
2| bucket span=4h _time 
3| stats count AS alerts values(Title) as Title values(Types{}) as Types values(vendor_account) as vendor_account values(vendor_region) as vendor_region values(severity) as severity by _time dest 
4| eventstats avg(alerts) as total_alerts_avg, stdev(alerts) as total_alerts_stdev 
5| eval threshold_value = 3 
6| eval isOutlier=if(alerts > total_alerts_avg+(total_alerts_stdev * threshold_value), 1, 0) 
7| search isOutlier=1 
8| table _time dest alerts Title Types vendor_account vendor_region severity isOutlier total_alerts_avg 
9| `detect_spike_in_aws_security_hub_alerts_for_ec2_instance_filter`

Data Source

Name Platform Sourcetype Source
AWS Security Hub AWS icon AWS 'aws:securityhub:finding' 'aws_securityhub_finding'

Macros Used

Name Value
aws_securityhub_finding sourcetype="aws:securityhub:finding"
detect_spike_in_aws_security_hub_alerts_for_ec2_instance_filter search *
detect_spike_in_aws_security_hub_alerts_for_ec2_instance_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
NistCategory.DE_AE
Cis18Value.CIS_10

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Risk Event True
This configuration file applies to all detections of type anomaly. These detections will use Risk Based Alerting.

Implementation

You must install the AWS App for Splunk (version 5.1.0 or later) and Splunk Add-on for AWS (version 4.4.0 or later), then configure your Security Hub inputs. The threshold_value should be tuned to your environment and schedule these searches according to the bucket span interval.

Known False Positives

None

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message Risk Score Impact Confidence
Spike in AWS security Hub alerts with title $Title$ for EC2 instance $dest$ 15 30 50
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset aws_securityhub_finding aws:securityhub:finding
Integration ✅ Passing Dataset aws_securityhub_finding aws:securityhub:finding

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub | Version: 5