MS SENTINEL
Audit Logs Account Enabled
// Account Enabled / Re-enabled by medhatfathy
// Entra ID: AuditLogs "Enable account"
// On-Prem AD: SecurityEvent 4722 (account enabled)
// Optional context: 4725 (account disabled) to show prior disable events
union isfuzzy=true
(
AuditLogs
| where Category =~ "UserManagement"
| where ActivityDisplayName =~ "Enable account"
| where Result =~ "success"
| mv-expand TargetResources
| where tostring(TargetResources.type) =~ "User"
| extend TargetUPN = tostring(TargetResources.userPrincipalName)
| extend InitiatedByUser = tostring(InitiatedBy.user.userPrincipalName),
InitiatedByApp = tostring(InitiatedBy.app.displayName)
),
(
SecurityEvent
| where EventID in (4722, 4725) // 4722=Enabled, 4725=Disabled
| extend X = parse_xml(EventData)
| extend
SubjectUserName = tostring(X.EventData.Data[1]["#text"]),
SubjectDomainName = tostring(X.EventData.Data[2]["#text"]),
SubjectLogonId = tostring(X.EventData.Data[3]["#text"]),
TargetUserName = tostring(X.EventData.Data[5]["#text"]),
TargetDomainName = tostring(X.EventData.Data[6]["#text"])
| extend Action = case(EventID == 4722, "Account enabled (4722)",
EventID == 4725, "Account disabled (4725)",
"Account change")
)
| order by TimeGenerated descRule Description
Detection Logic
Severity
MITRE ATT&CK Mapping
Potential Risks
Expected Behavior
Recommended Enhancements
MITRE ATT&CK Mapping
Scheduled Task Created/Modified/Deleted
Rule Description
Detection Logic
What it monitors
What it extracts
Data Sources
Trigger Condition
Severity
MITRE ATT&CK Mapping
Potential Risks
Expected Behavior
Recommended Tuning
1) Reduce noise by focusing on Created/Updated only
2) Add allowlist for known service/admin automation accounts
3) Flag suspicious task locations (
Password Reset – (Entra ID + On-Prem AD)
Detection Query (KQL)
Rule Description
Detection Logic
What the rule monitors
What it extracts
Data Sources
Trigger Condition
Severity
MITRE ATT&CK Mapping
Potential Risks
Expected Behavior
Recommended Tuning
Last updated