Try in Splunk Security Cloud

Description

This search looks for EC2 instances being modified by users who have not previously modified them. This search is deprecated and have been translated to use the latest Change Datamodel.

  • Type: Anomaly
  • Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud

  • Last Updated: 2020-07-21
  • Author: David Dorsey, Splunk
  • ID: 56f91724-cf3f-4666-84e1-e3712fb41e76

Annotations

ATT&CK
ID Technique Tactic
T1078.004 Cloud Accounts Defense Evasion, Initial Access, Persistence, Privilege Escalation
Kill Chain Phase
  • Exploitation
NIST
  • ID.AM
CIS20
  • CIS 1
CVE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
`cloudtrail` `ec2_modification_api_calls` [search `cloudtrail` `ec2_modification_api_calls` errorCode=success 
| stats earliest(_time) as firstTime latest(_time) as lastTime by userIdentity.arn 
| rename userIdentity.arn as arn 
| inputlookup append=t previously_seen_ec2_modifications_by_user 
| stats min(firstTime) as firstTime, max(lastTime) as lastTime by arn 
| outputlookup previously_seen_ec2_modifications_by_user 
| eval newUser=if(firstTime >= relative_time(now(), "-70m@m"), 1, 0) 
| where newUser=1 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| rename arn as userIdentity.arn 
| table userIdentity.arn] 
| spath output=dest responseElements.instancesSet.items{}.instanceId 
| spath output=user userIdentity.arn 
| table _time, user, dest 
| `ec2_instance_modified_with_previously_unseen_user_filter`

Macros

The SPL above uses the following Macros:

Note that ec2_instance_modified_with_previously_unseen_user_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Lookups

The SPL above uses the following Lookups:

Required field

  • _time
  • errorCode
  • userIdentity.arn

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 AWS CloudTrail inputs. This search works best when you run the “Previously Seen EC2 Launches By User” support search once to create a history of previously seen ARNs. To add or remove APIs that modify an EC2 instance, edit the macro ec2_modification_api_calls.

Known False Positives

It’s possible that a new user will start to modify EC2 instances when they haven’t before for any number of reasons. Verify with the user that is modifying instances that this is the intended behavior.

Associated Analytic story

RBA

Risk Score Impact Confidence Message
25.0 50 50 tbd

Reference

Test Dataset

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 | version: 3