Detection rules › Splunk

Windows AD GPO Deleted

Status
production
Severity
medium
Group by
LogonId, ObjectDN, OpCorrelationID
Author
Dean Luxton
Source
github.com/splunk/security_content

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

Known false positives

  • No false positives have been identified at this time.

MITRE ATT&CK coverage

Telemetry coverage

Rule body

name: Windows AD GPO Deleted
id: 0d41772b-35ab-4e1c-a2ba-d0b455481aee
version: 12
creation_date: '2024-07-01'
modification_date: '2026-05-13'
author: Dean Luxton
status: production
type: TTP
description: This detection identifies when an Active Directory Group Policy is deleted using the Group Policy Management Console.
data_source:
    - Windows Event Log Security 5136
search: |-
    `wineventlog_security` EventCode=5136 AttributeLDAPDisplayName=gpLink
      | eval  ObjectDN=upper(ObjectDN)
      | 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 values(dest) as dest
        BY OpCorrelationID ObjectDN SubjectLogonId
      | rex field=old_value max_match=10000 "(?i)LDAP://(?P<old_dn>cn.*?);(?P<old_flag>\d)\]"
      | rex field=new_value max_match=10000 "(?i)LDAP://(?P<new_dn>cn.*?);(?P<new_flag>\d)\]"
      | mvexpand old_dn
      | where NOT old_dn IN (new_dn)
      | eval ObjectDN=upper(old_dn)
      | join ObjectDN type=outer [
      | search `admon` objectCategory="CN=Group-Policy-Container*" admonEventType=Update
      | eval ObjectDN=upper(distinguishedName)
      | stats latest(displayName) as displayName
        BY ObjectDN ]
      | stats min(eventTime) as _time values(OpCorrelationID) as OpCorrelationID values(displayName) as policyName values(src_user) as src_user
        BY ObjectDN SubjectLogonId
      | `windows_ad_gpo_deleted_filter`
how_to_implement: 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: No false positives have been identified at this time.
references:
    - https://lantern.splunk.com/Security/Product_Tips/Enterprise_Security/Enabling_an_audit_trail_from_Active_Directory
finding:
    title: GPO $policyName$ was deleted by $src_user$
    entity:
        field: src_user
        type: user
        score: 50
analytic_story:
    - Sneaky Active Directory Persistence Tricks
asset_type: Endpoint
mitre_attack_id:
    - T1685
    - T1484.001
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: endpoint
security_domain: endpoint

Stages and Predicates

Stage 1: search

`wineventlog_security` EventCode=5136 AttributeLDAPDisplayName=gpLink

Stage 2: eval

| eval  ObjectDN=upper(ObjectDN)

Stage 3: stats

| 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 values(dest) as dest
    BY OpCorrelationID ObjectDN SubjectLogonId

Stage 4: rex

| rex field=old_value max_match=10000 "(?i)LDAP://(?P<old_dn>cn.*?);(?P<old_flag>\d)\]"

Stage 5: rex

| rex field=new_value max_match=10000 "(?i)LDAP://(?P<new_dn>cn.*?);(?P<new_flag>\d)\]"

Stage 6: mvexpand

| mvexpand old_dn

Stage 7: where

| where NOT old_dn IN (new_dn)

Stage 8: eval

| eval ObjectDN=upper(old_dn)

Stage 9: join

| join ObjectDN type=outer [
  | search `admon` objectCategory="CN=Group-Policy-Container*" admonEventType=Update
  | eval ObjectDN=upper(distinguishedName)
  | stats latest(displayName) as displayName
    BY ObjectDN ]

Stage 10: stats

| stats min(eventTime) as _time values(OpCorrelationID) as OpCorrelationID values(displayName) as policyName values(src_user) as src_user
    BY ObjectDN SubjectLogonId

Stage 11: search

| `windows_ad_gpo_deleted_filter`

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
old_dneqnew_dnexcludes:old_dn field:"old_dn" value:"new_dn"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
AttributeLDAPDisplayNameeq
  • gpLink
field:"AttributeLDAPDisplayName" kind:eq value:"gpLink"
EventCodeeq
  • 5136 corpus 45 (splunk 24, kusto 18, elastic 3)
field:"EventID" kind:eq value:"5136"
admonEventTypeeq
  • Update corpus 5 (splunk 5)
field:"admonEventType" kind:eq value:"Update"
objectCategoryeq
  • "CN=Group-Policy-Container*" corpus 3 (splunk 3)
field:"objectCategory" kind:eq