← Back to SOC feed Coverage →

Services

kql MEDIUM Azure-Sentinel
DeviceRegistryEvents
huntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-22T23:00:00Z · Confidence: medium

Hunt Hypothesis

The hypothesis is that an adversary may be leveraging registry-based service configurations to persistently execute malicious payloads across system reboots. A SOC team should proactively hunt for this behavior in Azure Sentinel to identify potential persistence mechanisms and mitigate long-term compromise risks.

KQL Query

DeviceRegistryEvents  
| where RegistryKey has @"SYSTEM\CurrentControlSet\Services"
| extend ServiceName=tostring(split(RegistryKey, @"\")[4])
| project Timestamp, DeviceName, ServiceName, ActionType, InitiatingProcessAccountName, InitiatingProcessFileName, InitiatingProcessFolderPath, InitiatingProcessCommandLine, InitiatingProcessMD5, InitiatingProcessParentFileName
| top 100 by Timestamp desc 

Analytic Rule Definition

id: dd76f1c0-edc9-45cb-aeae-f5142caf583c
name: Services
description: |
  Gets the service name from the registry key.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceRegistryEvents
query: |
  DeviceRegistryEvents  
  | where RegistryKey has @"SYSTEM\CurrentControlSet\Services"
  | extend ServiceName=tostring(split(RegistryKey, @"\")[4])
  | project Timestamp, DeviceName, ServiceName, ActionType, InitiatingProcessAccountName, InitiatingProcessFileName, InitiatingProcessFolderPath, InitiatingProcessCommandLine, InitiatingProcessMD5, InitiatingProcessParentFileName
  | top 100 by Timestamp desc 

Required Data Sources

Sentinel TableNotes
DeviceRegistryEventsEnsure this data connector is enabled

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/General queries/Services.yaml