Detection rules › Splunk

Windows Defender ASR Rules Stacking

Status
production
Group by
ID, Parent_Commandline, Path, Process_Name, host, signature_id
Author
Michael Haag, Splunk
Source
github.com/splunk/security_content

The following analytic identifies security events from Microsoft Defender, focusing on Exploit Guard and Attack Surface Reduction (ASR) features. It detects Event IDs 1121, 1126, 1131, and 1133 for blocked operations, and Event IDs 1122, 1125, 1132, and 1134 for audit logs. Event ID 1129 indicates user overrides, while Event ID 5007 signals configuration changes. This detection uses a lookup to correlate ASR rule GUIDs with descriptive names. Monitoring these events is crucial for identifying unauthorized operations, potential security breaches, and policy enforcement issues. If confirmed malicious, attackers could bypass security measures, execute unauthorized actions, or alter system configurations.

MITRE ATT&CK coverage

Event coverage

Rule body splunk

name: Windows Defender ASR Rules Stacking
id: 425a6657-c5e4-4cbb-909e-fc9e5d326f01
version: 8
creation_date: '2023-12-06'
modification_date: '2026-05-13'
author: Michael Haag, Splunk
status: production
type: Hunting
description: The following analytic identifies security events from Microsoft Defender, focusing on Exploit Guard and Attack Surface Reduction (ASR) features. It detects Event IDs 1121, 1126, 1131, and 1133 for blocked operations, and Event IDs 1122, 1125, 1132, and 1134 for audit logs. Event ID 1129 indicates user overrides, while Event ID 5007 signals configuration changes. This detection uses a lookup to correlate ASR rule GUIDs with descriptive names. Monitoring these events is crucial for identifying unauthorized operations, potential security breaches, and policy enforcement issues. If confirmed malicious, attackers could bypass security measures, execute unauthorized actions, or alter system configurations.
data_source:
    - Windows Event Log Defender 1121
    - Windows Event Log Defender 1122
    - Windows Event Log Defender 1125
    - Windows Event Log Defender 1126
    - Windows Event Log Defender 1129
    - Windows Event Log Defender 1131
    - Windows Event Log Defender 1133
    - Windows Event Log Defender 1134
    - Windows Event Log Defender 5007
search: |-
    `ms_defender` EventCode IN (1121, 1122, 1125, 1126, 1129, 1131, 1132, 1133, 1134, 5007)
      | stats count min(_time) as firstTime max(_time) as lastTime
        BY host Parent_Commandline, Process_Name,
           Path, ID, EventCode
      | lookup asr_rules ID OUTPUT ASR_Rule
      | fillnull value=NULL
      | `security_content_ctime(firstTime)`
      | `security_content_ctime(lastTime)`
      | rename host as dest
      | `windows_defender_asr_rules_stacking_filter`
how_to_implement: The following analytic requires collection of Windows Defender Operational logs in either XML or multi-line. To collect, setup a new input for the Windows Defender Operational logs. In addition, it does require a lookup that maps the ID to ASR Rule name. Note that Audit and block Event IDs have different fields, therefore the analytic will need to be modified for each type of event. The analytic can be modified to look for specific ASR rules, or to look for specific Event IDs. EventID 5007 is a change in the registry, and may be a false positive. This can be removed from the search if desired.
known_false_positives: False positives are not expected with this analytic, since it is a hunting analytic. It is meant to show the use of ASR rules and how they can be used to detect malicious activity.
references:
    - https://asrgen.streamlit.app/
    - https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/attack-surface-reduction?view=o365-worldwide
analytic_story:
    - Windows Attack Surface Reduction
asset_type: Endpoint
mitre_attack_id:
    - T1566.001
    - T1566.002
    - T1059
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: endpoint
security_domain: endpoint
tests:
    - name: True Positive Test
      attack_data:
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1059/defender/asr_defender_operational.log
          source: WinEventLog:Microsoft-Windows-Windows Defender/Operational
          sourcetype: XmlWinEventLog
      test_type: unit

Stages and Predicates

Stage 1: search

`ms_defender` EventCode IN (1121, 1122, 1125, 1126, 1129, 1131, 1132, 1133, 1134, 5007)

Stage 2: stats

| stats count min(_time) as firstTime max(_time) as lastTime
    BY host Parent_Commandline, Process_Name,
       Path, ID, EventCode

Stage 3: lookup

| lookup asr_rules ID OUTPUT ASR_Rule
Lookup table
asr_rules
Key field
ID
Output columns
['ASR_Rule', 'ASR_Rule']

Stage 4: fillnull

| fillnull value=NULL

Stage 5: search

| `security_content_ctime(firstTime)`

Stage 6: search

| `security_content_ctime(lastTime)`

Stage 7: rename

| rename host as dest

Stage 8: search

| `windows_defender_asr_rules_stacking_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
EventCodein
  • 1121
  • 1122
  • 1125
  • 1126
  • 1129
  • 1131
  • 1132
  • 1133
  • 1134
  • 5007 corpus 2 (splunk 2)