Detection: Windows AD GPO Deleted

Description

This detection identifies when an Active Directory Group Policy is deleted using the Group Policy Management Console.

 1`wineventlog_security` EventCode=5136 AttributeLDAPDisplayName=gpLink 
 2| eval  ObjectDN=upper(ObjectDN) 
 3| stats min(_time) as eventTime values(eval(if(OperationType=="%%14675",AttributeValue,null))) as old_value values(eval(if(OperationType=="%%14674",AttributeValue,null))) as new_value values(OperationType) as OperationType values(src_user) as src_user by OpCorrelationID ObjectDN SubjectLogonId 
 4| rex field=old_value max_match=10000 "(?i)LDAP://(?P<old_dn>cn.*?);(?P<old_flag>\d)\]" 
 5| rex field=new_value max_match=10000 "(?i)LDAP://(?P<new_dn>cn.*?);(?P<new_flag>\d)\]" 
 6| mvexpand old_dn 
 7| where NOT old_dn IN (new_dn) 
 8| eval ObjectDN=upper(old_dn) 
 9| join ObjectDN type=outer [
10| search `admon` objectCategory="CN=Group-Policy-Container*" admonEventType=Update 
11| eval ObjectDN=upper(distinguishedName) 
12| stats latest(displayName) as displayName by ObjectDN ] 
13| stats min(eventTime) as _time values(OpCorrelationID) as OpCorrelationID values(displayName) as policyName values(src_user) as src_user by ObjectDN SubjectLogonId 
14| `windows_ad_gpo_deleted_filter`

Data Source

No data sources specified for this detection.

Macros Used

Name Value
admon source=ActiveDirectory
windows_ad_gpo_deleted_filter search *
windows_ad_gpo_deleted_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
T1562.001 Disable or Modify Tools Defense Evasion
T1484.001 Group Policy Modification Defense Evasion
KillChainPhase.EXPLOITAITON
NistCategory.DE_CM
Cis18Value.CIS_10
Agrius
Aquatic Panda
BRONZE BUTLER
Ember Bear
FIN6
Gamaredon Group
Gorgon Group
INC Ransom
Indrik Spider
Kimsuky
Lazarus Group
Magic Hound
MuddyWater
Play
Putter Panda
Rocke
Saint Bear
TA2541
TA505
TeamTNT
Turla
Wizard Spider
APT41
Cinnamon Tempest
Indrik Spider

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 Notable Yes
Rule Title %name%
Rule Description %description%
Notable Event Fields user, dest
Creates Risk Event True
This configuration file applies to all detections of type TTP. These detections will use Risk Based Alerting and generate Notable Events.

Implementation

Ensure you are ingesting Active Directory audit logs - specifically event 5136, admon data is also used to display the display name of the GPO. See lantern article in references for further on how to onboard AD audit data. Ensure the wineventlog_security and admon macros are configured with the correct indexes.

Known False Positives

Unknown

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message Risk Score Impact Confidence
GPO $policyName$ was deleted by $src_user$ 64 80 80
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset XmlWinEventLog:Security XmlWinEventLog
Integration ✅ Passing Dataset XmlWinEventLog:Security XmlWinEventLog

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: 2