Skip to content

Commit f58e833

Browse files
[Rule Tuning] Suspicious Entra ID OAuth User Impersonation Scope Detected (#5190)
<!-- Thank you for your interest in and contributing to Detection Rules! There are a few simple things to check before submitting your pull request that can help with the review process. You should delete these items from your submission, but they are here to help bring them to your attention. --> # Pull Request *Issue link(s)*: * #5189 <!-- Add Related Issues / PRs for context. Eg: Related to elastic/repo#999 Resolves #123 If there is no issue link, take extra care to write a clear summary and label the PR just as you would label an issue to give additional context to reviewers. --> ## Summary - What I changed Tunes `Suspicious Entra ID OAuth User Impersonation Scope Detected (9563dace-5822-11f0-b1d3-f661ea17fbcd)` rule to reduce FPs. Please see related issue for more information. <!-- Summarize your PR. Animated gifs are 💯. Code snippets are ⚡️. Examples & screenshots are 🔥 --> ## How To Test Query can be used in TRADE stack. TeamFiltration testing and matches occurred in July 2025. <!-- Some examples of what you could include here are: * Links to GitHub action results for CI test improvements * Sample data before/after screenshots (or short videos showing how something works) * Copy/pasted commands and output from the testing you did in your local terminal window * If tests run in GitHub, you can 🪁or 🔱, respectively, to indicate tests will run in CI * Query used in your stack to verify the change --> ## Checklist <!-- Delete any items that are not applicable to this PR. --> - [ ] Added a label for the type of pr: `bug`, `enhancement`, `schema`, `maintenance`, `Rule: New`, `Rule: Deprecation`, `Rule: Tuning`, `Hunt: New`, or `Hunt: Tuning` so guidelines can be generated - [ ] Added the `meta:rapid-merge` label if planning to merge within 24 hours - [ ] Secret and sensitive material has been managed correctly - [ ] Automated testing was updated or added to match the most common scenarios - [ ] Documentation and comments were added for features that require explanation ## Contributor checklist - Have you signed the [contributor license agreement](https://www.elastic.co/contributor-agreement)? - Have you followed the [contributor guidelines](https://github.com/elastic/detection-rules/blob/main/CONTRIBUTING.md)?
1 parent a3cb002 commit f58e833

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

rules/integrations/azure/initial_access_entra_id_oauth_user_impersonation_scope.toml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/07/03"
33
integration = ["azure"]
44
maturity = "production"
5-
updated_date = "2025/09/26"
5+
updated_date = "2025/10/06"
66

77
[rule]
88
author = ["Elastic"]
@@ -18,10 +18,10 @@ from = "now-9m"
1818
index = ["filebeat-*", "logs-azure.signinlogs-*"]
1919
language = "kuery"
2020
license = "Elastic License v2"
21-
name = "Suspicious Entra ID OAuth User Impersonation Scope Detected"
21+
name = "Entra ID OAuth user_impersonation Scope for Unusual User and Client"
2222
note = """## Triage and Analysis
2323
24-
### Investigating Suspicious Entra ID OAuth User Impersonation Scope Detected
24+
### Investigating Entra ID OAuth user_impersonation Scope for Unusual User and Client
2525
2626
Identifies rare occurrences of OAuth workflow for a user principal that is single factor authenticated, with an OAuth scope containing `user_impersonation`, and a token issuer type of `AzureAD`. This rule is designed to detect suspicious
2727
OAuth user impersonation attempts in Microsoft Entra ID, particularly those involving the `user_impersonation` scope, which is often used by adversaries to gain unauthorized access to user accounts. The rule focuses on sign-in events where
@@ -82,9 +82,42 @@ event.dataset: azure.signinlogs and
8282
azure.signinlogs.properties.token_issuer_type: "AzureAD" and
8383
azure.signinlogs.properties.token_protection_status_details.sign_in_session_status: "unbound" and
8484
azure.signinlogs.properties.user_type: "Member" and
85+
azure.signinlogs.properties.conditional_access_status: "notApplied" and
86+
not user_agent.original: Mozilla*PKeyAuth/1.0 and
87+
not azure.signinlogs.properties.device_detail.operating_system: (Ios* or Android*) and
8588
event.outcome: "success"
89+
and not azure.signinlogs.properties.app_id: (
90+
"a5f63c0-b750-4f38-a71c-4fc0d58b89e2" or
91+
"6bc3b958-689b-49f5-9006-36d165f30e00" or
92+
"66a88757-258c-4c72-893c-3e8bed4d6899" or
93+
"cc15fd57-2c6c-4117-a88c-83b1d56b4bbe" or
94+
"0000000c-0000-0000-c000-000000000000"
95+
)
8696
'''
8797

98+
[rule.investigation_fields]
99+
field_names = [
100+
"@timestamp",
101+
"azure.correlation_id",
102+
"azure.signinlogs.category",
103+
"azure.signinlogs.identity",
104+
"azure.signinlogs.properties.app_display_name",
105+
"azure.signinlogs.properties.app_id",
106+
"azure.signinlogs.properties.app_owner_tenant_id",
107+
"azure.signinlogs.properties.authentication_requirement",
108+
"azure.signinlogs.properties.client_credential_type",
109+
"azure.signinlogs.properties.conditional_access_status",
110+
"azure.signinlogs.properties.device_detail.operating_system",
111+
"azure.signinlogs.properties.is_interactive",
112+
"azure.signinlogs.properties.session_id",
113+
"azure.signinlogs.properties.user_principal_name",
114+
"azure.signinlogs.properties.user_type",
115+
"azure.signinlogs.result_signature",
116+
"azure.tenant_id",
117+
"source.address",
118+
"user.id"
119+
]
120+
88121

89122
[[rule.threat]]
90123
framework = "MITRE ATT&CK"

0 commit comments

Comments
 (0)