Repository navigation
Add hunting queries: Entra ID tenant policy changes hunting pack (3 queries) - #15517
v-atulyadav merged 2 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the three new tenant-wide policy-change hunting queries.
No open issues 🎉
What changed in this PR
Adds three AuditLogs hunting queries for tenant-wide Microsoft Entra ID policy changes, complementing existing user-level detections. This continues #15321 with the previously reviewed fixes preserved.
Changes:
- Reports authentication-method setting changes with old/new values and enabled/disabled labels.
- Highlights sensitive authorization-policy settings, distinguishes first recorded values, and shows list additions/removals.
- Correlates device-registration policy changes with the same actor’s tenant-policy activity in fixed hourly buckets.
| File | Description |
|---|---|
| Hunting Queries/AuditLogs/TenantAuthorizationPolicyChanged.yaml | Adds per-setting authorization-policy hunting with sensitivity flags and list differences. |
| Hunting Queries/AuditLogs/DeviceRegistrationPolicyChanged.yaml | Adds device-registration policy hunting with hourly actor correlation. |
| Hunting Queries/AuditLogs/AuthenticationMethodsPolicyChanged.yaml | Adds per-setting authentication-method policy hunting with state-change labels. |
Review effort: Balanced
|
Hey Descambiado (@descambiado) |
|
Thanks for the review v-skharode. I took the first option.
|
Continuation of #15321
This PR replaces #15321. The review there is finished (Copilot's three points and the last one from v-skharode are applied), but its
license/clastatus never registered after I force-pushed to replace the author email with my GitHub noreply address, and it has stayed pending for two weeks even after the agree comment. This branch is a single commit on top of currentmasterwith the same three files, byte for byte, as the last commit of #15321 (d2a772835d). My two previous PRs opened this way (#15434 and #15444) registered the CLA normally. I will close #15321 once this one is open.Review points already applied in those files:
#EXT#is matched without regard to case.PermissionGrantPolicyIdsan empty list is a real value.Idinstead ofCorrelationId, which can be empty or shared across activities.Summary
Three hunting queries for changes to tenant-wide Entra ID policies. A change to one of these policies weakens every account in the tenant at once, and user-level detections (MFA registration, Temporary Access Pass creation, app registration) never see it. I searched the repository on 14 October for the three operations (
Authentication Methods Policy Update,Update authorization policy,Set device registration policies) and found none in AuditLogs; the only match is a CloudAppEvents hunting query forUpdate authorization policy.Change(s):
AuthenticationMethodsPolicyChanged,TenantAuthorizationPolicyChangedandDeviceRegistrationPolicyChangedunderHunting Queries/AuditLogs.Reason for Change(s):
Version Updated:
AuthenticationMethodsPolicyChanged (AuditLogs)
One row per changed setting of the authentication methods policy: method, setting, whether a method was enabled or disabled, and the old and new value. The entry that holds the values is not the first
TargetResourcesentry, so every entry is expanded instead of reading a fixed index.MITRE: T1556.006, T1098
TenantAuthorizationPolicyChanged (AuditLogs)
One row per changed setting of the authorization policy (what ordinary users may do by default: create apps, groups or tenants, invite guests, consent to applications). It marks sensitive settings, separates a first recorded value from a change, and for list values shows which items were added or removed. Saving the user settings page in the portal added two Teams and chat permission grant policies by itself, so the added items matter.
MITRE: T1098, T1528
DeviceRegistrationPolicyChanged (AuditLogs)
Who changed the device registration policy and when, plus how many other tenant policy changes the same person made in the same hour. This event carries no old or new value, and the description says so. The account is normalized before comparing, because the same external account is written in two forms by different services.
MITRE: T1098.005
Testing Completed
modifiedPropertiescome from real events captured by changing each of the three policies in my own Entra ID tenant (25 events, read through Microsoft Graph).TargetResourcesentry, nested setting names, application actors, a consent policy change to the legacy policy, mixed case account names, bursts across two hours) as an inlinedatatablein Log Analytics. Each returned the expected rows. After the review changes I also compared the old and new versions of each query on the same data, plus synthetic cases for the guest suffix in lower case, two applications with the same display name, and two unidentified events with an empty or sharedCorrelationId.InitiatedBy,TargetResources,modifiedPropertieswithdisplayName,oldValueandnewValueas JSON encoded strings) have the same structure in Graph and in the oneAuditLogsrecord that workspace did ingest, which I compared.AuditLogstable in Log Analytics (Microsoft's public demo workspace and my own workspace; both tables are empty, so this checks the schema and the query engine, not the results), and an invented column fails there with SEM0100.Validation
Kqlvalidations.Testspasses locally for the three files (6 of 6).DefenseEvasion, which ATT&CK now calls Defense Impairment for T1556.006.