Detection rules › Splunk
Cloud Security Groups Modifications by User
The following analytic identifies unusual modifications to security groups in your cloud environment by users, focusing on actions such as modifications, deletions, or creations over 30-minute intervals. It leverages cloud infrastructure logs and calculates the standard deviation for each user, using the 3-sigma rule to detect anomalies. This activity is significant as it may indicate a compromised account or insider threat. If confirmed malicious, attackers could alter security group configurations, potentially exposing sensitive resources or disrupting services.
Known false positives
- It is possible that legitimate user/admin may modify a number of security groups
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment |
Rule body
name: Cloud Security Groups Modifications by User
id: cfe7cca7-2746-4bdf-b712-b01ed819b9de
version: 9
creation_date: '2024-03-06'
modification_date: '2026-05-13'
author: Bhavin Patel, Splunk
status: production
type: Anomaly
description: The following analytic identifies unusual modifications to security groups in your cloud environment by users, focusing on actions such as modifications, deletions, or creations over 30-minute intervals. It leverages cloud infrastructure logs and calculates the standard deviation for each user, using the 3-sigma rule to detect anomalies. This activity is significant as it may indicate a compromised account or insider threat. If confirmed malicious, attackers could alter security group configurations, potentially exposing sensitive resources or disrupting services.
data_source:
- AWS CloudTrail
search: |-
| tstats dc(All_Changes.object) as unique_security_groups values(All_Changes.src) as src values(All_Changes.user_type) as user_type values(All_Changes.object_category) as object_category values(All_Changes.object) as objects values(All_Changes.action) as action values(All_Changes.user_agent) as user_agent values(All_Changes.command) as command FROM datamodel=Change
WHERE All_Changes.object_category = "security_group" (All_Changes.action = modified
OR
All_Changes.action = deleted
OR
All_Changes.action = created)
BY All_Changes.user _time span=30m
| `drop_dm_object_name("All_Changes")`
| eventstats avg(unique_security_groups) as avg_changes , stdev(unique_security_groups) as std_changes
BY user
| eval upperBound=(avg_changes+std_changes*3)
| eval isOutlier=if(unique_security_groups > 2 and unique_security_groups >= upperBound, 1, 0)
| where isOutlier=1
| `cloud_security_groups_modifications_by_user_filter`
how_to_implement: This search requries the Cloud infrastructure logs such as AWS Cloudtrail, GCP Pubsub Message logs, Azure Audit logs to be ingested into an accelerated Change datamodel. It is also recommended that users can try different combinations of the `bucket` span time and outlier conditions to better suit with their environment.
known_false_positives: It is possible that legitimate user/admin may modify a number of security groups
references:
- https://attack.mitre.org/techniques/T1578/005/
intermediate_findings:
entities:
- field: user
type: user
score: 20
message: Unsual number cloud security group modifications detected by user - $user$
analytic_story:
- Suspicious Cloud User Activities
asset_type: Cloud Instance
mitre_attack_id:
- T1578.005
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
category: cloud
security_domain: threat
Stages and Predicates
Stage 1: tstats
| tstats dc(All_Changes.object) as unique_security_groups values(All_Changes.src) as src values(All_Changes.user_type) as user_type values(All_Changes.object_category) as object_category values(All_Changes.object) as objects values(All_Changes.action) as action values(All_Changes.user_agent) as user_agent values(All_Changes.command) as command FROM datamodel=Change
WHERE All_Changes.object_category = "security_group" (All_Changes.action = modified
OR
All_Changes.action = deleted
OR
All_Changes.action = created)
BY All_Changes.user _time span=30m
Stage 2: search
| `drop_dm_object_name("All_Changes")`
Stage 3: eventstats
| eventstats avg(unique_security_groups) as avg_changes , stdev(unique_security_groups) as std_changes
BY user
Stage 4: eval
| eval upperBound=(avg_changes+std_changes*3)
Stage 5: eval
| eval isOutlier=if(unique_security_groups > 2 and unique_security_groups >= upperBound, 1, 0)
isOutlier =if
unique_security_groups > 2 AND unique_security_groups >= upperBound1else
0Stage 6: where
| where isOutlier=1
Stage 7: search
| `cloud_security_groups_modifications_by_user_filter`
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
All_Changes.action | eq |
| field:"All_Changes.action" kind:eq |
All_Changes.object_category | eq |
| field:"All_Changes.object_category" kind:eq |
isOutlier | eq |
| field:"isOutlier" kind:eq value:"1" |