Add hunting queries: Entra ID identity boundary expansion hunting pack (3 queries)#14307
Merged
v-atulyadav merged 5 commits intoMay 28, 2026
Conversation
Detects Update user operations in AuditLogs where UserType transitions from Guest to Member, surfacing potential attacker elevation of a compromised guest to full tenant membership.
…98.001) Detects Add owner to service principal operations. SP ownership grants full credential management rights and is a documented precursor step in post-compromise persistence chains (Midnight Blizzard pattern).
Detects Update application operations where the ReplyUrls field changes, surfacing attacker-added redirect URIs that can intercept OAuth authorization codes for token theft.
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a small hunting pack of Entra ID identity boundary expansion queries (AuditLogs) to help identify persistence/credential-access behaviors that change permission surface without creating new accounts or directly adding credentials.
Changes:
- Added a hunt for new service principal owner assignments (T1098.001).
- Added a hunt for guest-to-member user type conversions (T1098).
- Added a hunt for application redirect URI modifications (T1528).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| Hunting Queries/AuditLogs/ServicePrincipalOwnerAdded.yaml | New AuditLogs-based hunt for “Add owner to service principal” events with account + IP entity mappings. |
| Hunting Queries/AuditLogs/GuestUserTypeChangedToMember.yaml | New AuditLogs-based hunt for “Update user” events where UserType changes from Guest → Member. |
| Hunting Queries/AuditLogs/ApplicationRedirectUriModified.yaml | New AuditLogs-based hunt for “Update application” events where ReplyUrls are modified, with account + IP entity mappings. |
Contributor
|
Hi @descambiado Kindly review the above comments and address them as needed. Thanks! |
…tity-boundary-hunting-pack
- ApplicationRedirectUriModified: Account entity now maps to ActorUpn only (not Actor, which can be an application display name when ActorUpn is empty); ActorApp projected separately for context - ServicePrincipalOwnerAdded: replace positional TargetResources[0]/[1] indexing with mv-apply + type-filtered take_anyif (ServicePrincipal vs User); normalize metadata indentation to 2-space
Contributor
Author
|
Pushed updates addressing the Copilot review on this hunting pack:
Merged latest master. |
v-maheshbh
approved these changes
May 28, 2026
v-atulyadav
approved these changes
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three hunting queries targeting identity boundary expansion techniques in Entra ID. Each covers a distinct operation that shifts the permission surface without creating new accounts or directly adding credentials — making them harder to catch with account-focused detections.
Queries added
GuestUserTypeChangedToMember.yaml— T1098Detects
Update userevents whereUserTypechanges fromGuesttoMember. A guest-to-member conversion grants the account full tenant membership including access to internal resources, group memberships, and SharePoint sites that exclude guests. Rare in most tenants; correlate against help desk records if it fires.ServicePrincipalOwnerAdded.yaml— T1098.001Detects
Add owner to service principalevents. SP ownership silently grants full credential management rights — an actor who becomes SP owner can then add a password or certificate credential and authenticate as the SP without triggering the separateAdd service principal credentialsoperation immediately. This is the documented precursor step in Midnight Blizzard-style persistence chains, and it sits in a detection gap between general role auditing and credential-focused detections.ApplicationRedirectUriModified.yaml— T1528Detects
Update applicationevents where theReplyUrlsfield changes. Adding an attacker-controlled redirect URI to an existing trusted app registration allows interception of OAuth authorization codes from users who click legitimate consent flows pointing to that app. No new app registration is required, so first-seen-app detections miss it entirely.What was verified
Hunting Queries/cover these three operationsOperationName =~(exact match within~/=~, nohas_any)InitiatedBy.user.userPrincipalNamefield access throughout, noparse_json(tostring(...))wrapper