[New Rule] Azure AD Graph Access with Unusual User and ASN#6171
Open
terrancedejesus wants to merge 8 commits into
Open
[New Rule] Azure AD Graph Access with Unusual User and ASN#6171terrancedejesus wants to merge 8 commits into
terrancedejesus wants to merge 8 commits into
Conversation
Contributor
Rule: New - GuidelinesThese guidelines serve as a reminder set of considerations when proposing a new rule. Documentation and Context
Rule Metadata Checks
New BBR Rules
Testing and Validation
|
bryans3c
reviewed
Jun 1, 2026
Contributor
bryans3c
left a comment
There was a problem hiding this comment.
Two little comments! Nice!
| Identifies Azure AD Graph (graph.windows.net) requests originating from network sources outside the major | ||
| public-cloud and Microsoft ASNs that legitimate first-party callers normally come from. Adversary tooling | ||
| typically rides on commodity hosting (residential ISPs, VPS providers, anonymisers) which produces an ASN | ||
| distribution very different from the Microsoft / AWS / GCP / Akamai / Cloudflare ranges that dominate |
Contributor
There was a problem hiding this comment.
Akamai and Cloudflare should be included in the query?
Contributor
Author
There was a problem hiding this comment.
Kept it to the big 3 for now. If we notice Akamai, Oracle, Cloudflare, IBM Cloud, etc. we will exclude on the first round of tuning.
|
|
||
| query = ''' | ||
| data_stream.dataset:azure.aadgraphactivitylogs and | ||
| user.id:* and source.as.number:(* and |
Contributor
There was a problem hiding this comment.
The user.id:* requirement excludes service-principal / application-token access, another companion rule could be interesting to catch it.
Contributor
Author
There was a problem hiding this comment.
user.id will be the SPID if the actor_type is Application. Happens on ECS normalization during ingestion.
bryans3c
approved these changes
Jun 1, 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.
Pull Request
Issue link(s):
Summary - What I changed
Adds a detection for AAD Graph access within unusual user and ASN. AAD Graph is not expected to be used, any use in general may point towards unauthorized activity. A user wit an unfamiliar ASN that is not a cloud provider could signal identity compromise from, for example phishing, that lead to AAD Graph enumeration of the tenant/directory.
How To Test
Query can be used in TRADE stack.
Checklist
bug,enhancement,schema,maintenance,Rule: New,Rule: Deprecation,Rule: Tuning,Hunt: New, orHunt: Tuningso guidelines can be generatedmeta:rapid-mergelabel if planning to merge within 24 hoursContributor checklist