[Rule Tuning] Microsoft Graph Request Email Access by Unusual User and Client#6378
Open
terrancedejesus wants to merge 2 commits into
Open
[Rule Tuning] Microsoft Graph Request Email Access by Unusual User and Client#6378terrancedejesus wants to merge 2 commits into
terrancedejesus wants to merge 2 commits into
Conversation
Contributor
Rule: Tuning - GuidelinesThese guidelines serve as a reminder set of considerations when tuning an existing rule. Documentation and Context
Rule Metadata Checks
Testing and Validation
|
Contributor
There was a problem hiding this comment.
Pull request overview
Tunes the Azure Microsoft Graph email-access New Terms rule to reduce false positives by narrowing the match conditions and keying first-seen detection on additional context.
Changes:
- Removes the OAuth-scope-based
ORmatching so the rule no longer alerts solely on token scopes. - Constrains matching to Graph mail-related
url.pathpatterns across/v1.0and/betafor/meand/users. - Extends the New Terms key to include
source.as.number(ASN) and updates rule metadataupdated_date.
Comment on lines
+14
to
+15
| object ID. This is a New Terms rule that only signals if the application ID, user principal object ID, and source ASN have not been | ||
| seen doing this activity historically. |
| ### Investigating Microsoft Graph Request Email Access by Unusual User and Client | ||
|
|
||
| This rule detects instances where a previously unseen or rare Microsoft Graph application client ID accesses email-related APIs, such as `/me/messages`, `/sendMail`, or `/mailFolders/inbox/messages`. These accesses are performed via delegated user credentials using common OAuth scopes like `Mail.Read`, `Mail.ReadWrite`, `Mail.Send`, or `email`. This activity may indicate unauthorized use of a newly consented or compromised application to read or exfiltrate mail content. This is a New Terms rule that only signals if the application ID (`azure.graphactivitylogs.properties.app_id`) and user principal object ID (`azure.graphactivitylogs.properties.user_principal_object_id`) have not been seen doing this activity in the last 14 days. | ||
| This rule detects instances where a previously unseen or rare Microsoft Graph application client ID accesses email-related API paths, such as `/v1.0/me/messages`, `/v1.0/me/mailFolders/inbox/messages`, or `/v1.0/users/{id}/messages`. The access is performed with a delegated user token issued to a first-party public client (public client authentication, no client secret), which is the token shape produced by phished OAuth refresh tokens or Primary Refresh Tokens (PRTs). This activity may indicate unauthorized use of a newly consented or compromised application to read or exfiltrate mail content. This is a New Terms rule that only signals if the application ID (`azure.graphactivitylogs.properties.app_id`), user principal object ID (`azure.graphactivitylogs.properties.user_principal_object_id`), and source ASN (`azure.graphactivitylogs.properties.source_asn`) have not been seen doing this activity historically. |
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
Tunes the
Microsoft Graph Request Email Access by Unusual User and Clientrule to remove OAuth scopes from theORcondition which caused unexpected false-positives since it matches on any token with those scopes authorized for the client. Linted as well. Merging after #6335 is merged.How To Test
Query can be used in TRADE stack or telemetry 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