name: Abnormally High AWS Instances Terminated by User
id: ada0f478-84a8-4641-s3f3-d82362dffd75
version: 2
date: '2020-07-21'
author: Bhavin Patel, Splunk
type: batch
datamodel: []
description: This search looks for CloudTrail events where an abnormally high number
  of instances were successfully terminated by a user in a 10-minute window. This
  search is deprecated and have been translated to use the latest Change Datamodel.
search: '`cloudtrail` eventName=TerminateInstances errorCode=success | bucket span=10m
  _time | stats count AS instances_terminated by _time userName | eventstats avg(instances_terminated)
  as total_terminations_avg, stdev(instances_terminated) as total_terminations_stdev
  | eval threshold_value = 4 | eval isOutlier=if(instances_terminated > total_terminations_avg+(total_terminations_stdev
  * threshold_value), 1, 0) | search isOutlier=1 AND _time >= relative_time(now(),
  "-10m@m")| eval num_standard_deviations_away = round(abs(instances_terminated -
  total_terminations_avg) / total_terminations_stdev, 2) |table _time, userName, instances_terminated,
  num_standard_deviations_away, total_terminations_avg, total_terminations_stdev |
  `abnormally_high_aws_instances_terminated_by_user_filter`'
how_to_implement: 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 CloudTrail
  inputs.
known_false_positives: Many service accounts configured with your AWS infrastructure
  are known to exhibit this behavior. Please adjust the threshold values and filter
  out service accounts from the output. Always verify whether this search alerted
  on a human user.
references: []
tags:
  analytic_story:
  - Suspicious AWS EC2 Activities
  asset_type: AWS Instance
  cis20:
  - CIS 13
  kill_chain_phases:
  - Actions on Objectives
  mitre_attack_id:
  - T1078.004
  nist:
  - DE.DP
  - DE.AE
  product:
  - Splunk Enterprise
  - Splunk Enterprise Security
  - Splunk Cloud
  required_fields:
  - _time
  - eventName
  - errorCode
  - userName
  security_domain: network
