Detection rules › Splunk

Cloud Instance Modified By Previously Unseen User

Status
production
Severity
low
Group by
All_Changes.user
Author
Rico Valdez, Splunk
Source
github.com/splunk/security_content

The following analytic identifies cloud instances being modified by users who have not previously modified them. It leverages data from the Change data model, focusing on successful modifications of EC2 instances. This activity is significant because it can indicate unauthorized or suspicious changes by potentially compromised or malicious users. If confirmed malicious, this could lead to unauthorized access, configuration changes, or potential disruption of cloud services, posing a significant risk to the organization's cloud infrastructure.

MITRE ATT&CK coverage

Rule body splunk

name: Cloud Instance Modified By Previously Unseen User
id: 7fb15084-b14e-405a-bd61-a6de15a40722
version: 12
creation_date: '2020-11-16'
modification_date: '2026-05-13'
author: Rico Valdez, Splunk
status: production
type: Anomaly
description: The following analytic identifies cloud instances being modified by users who have not previously modified them. It leverages data from the Change data model, focusing on successful modifications of EC2 instances. This activity is significant because it can indicate unauthorized or suspicious changes by potentially compromised or malicious users. If confirmed malicious, this could lead to unauthorized access, configuration changes, or potential disruption of cloud services, posing a significant risk to the organization's cloud infrastructure.
data_source:
    - AWS CloudTrail
search: |-
    | tstats `security_content_summariesonly` count earliest(_time) as firstTime, latest(_time) as lastTime values(All_Changes.object_id) as object_id values(All_Changes.command) as command FROM datamodel=Change
      WHERE All_Changes.action=modified All_Changes.change_type=EC2 All_Changes.status=success
      BY All_Changes.user
    | `drop_dm_object_name("All_Changes")`
    | lookup previously_seen_cloud_instance_modifications_by_user user as user OUTPUTNEW firstTimeSeen, enough_data
    | eventstats max(enough_data) as enough_data
    | where enough_data=1
    | eval firstTimeSeenUser=min(firstTimeSeen)
    | where isnull(firstTimeSeenUser) OR firstTimeSeenUser > relative_time(now(), "-24h@h")
    | table firstTime user command object_id count
    | `security_content_ctime(firstTime)`
    | `cloud_instance_modified_by_previously_unseen_user_filter`
how_to_implement: This search has a dependency on other searches to create and update a baseline of users observed to be associated with this activity. The search "Previously Seen Cloud Instance Modifications By User - Update" should be enabled for this detection to properly work.
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.
references: []
drilldown_searches:
    - name: View the detection results for - "$dest$"
      search: '%original_detection_search% | search  dest = "$dest$"'
      earliest_offset: $info_min_time$
      latest_offset: $info_max_time$
    - name: View risk events for the last 7 days for - "$dest$"
      search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$") | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
      earliest_offset: 7d
      latest_offset: "0"
intermediate_findings:
    entities:
        - field: user
          type: user
          score: 20
          message: User $user$ is modifying an instance $object_id$ for the first time.
analytic_story:
    - Suspicious Cloud Instance Activities
asset_type: AWS Instance
mitre_attack_id:
    - T1078.004
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: cloud
security_domain: threat
baselines:
    - Previously Seen Cloud Instance Modifications By User - Update
    - Previously Seen Cloud Instance Modifications By User - Initial
tests:
    - name: True Positive Test
      attack_data:
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/suspicious_behaviour/abnormally_high_cloud_instances_launched/cloudtrail_behavioural_detections.json
          sourcetype: aws:cloudtrail
          source: aws_cloudtrail
      description: PORTED MANUAL TEST - This search needs the baseline `Previously Seen Cloud Instance Modifications By User - Update` to be run first.
      test_type: experimental

Stages and Predicates

Stage 1: tstats

| tstats `security_content_summariesonly` count earliest(_time) as firstTime, latest(_time) as lastTime values(All_Changes.object_id) as object_id values(All_Changes.command) as command FROM datamodel=Change
  WHERE All_Changes.action=modified All_Changes.change_type=EC2 All_Changes.status=success
  BY All_Changes.user

Stage 2: search

| `drop_dm_object_name("All_Changes")`

Stage 3: lookup

| lookup previously_seen_cloud_instance_modifications_by_user user as user OUTPUTNEW firstTimeSeen, enough_data
Lookup table
previously_seen_cloud_instance_modifications_by_user
Key field
user
Output columns
['firstTimeSeen', 'firstTimeSeen'], ['enough_data', 'enough_data']

Stage 4: eventstats

| eventstats max(enough_data) as enough_data

Stage 5: where

| where enough_data=1

Stage 6: eval

| eval firstTimeSeenUser=min(firstTimeSeen)

Stage 7: where

| where isnull(firstTimeSeenUser) OR firstTimeSeenUser > relative_time(now(), "-24h@h")

Stage 8: table

| table firstTime user command object_id count

Stage 9: search

| `security_content_ctime(firstTime)`

Stage 10: search

| `cloud_instance_modified_by_previously_unseen_user_filter`

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
All_Changes.actioneq
  • modified
All_Changes.change_typeeq
  • EC2
All_Changes.statuseq
  • success
enough_dataeq
  • 1
firstTimeSeenUseris_null
  • (no value, null check)