Entra ID User Sign-in with Unusual Client
Detects rare non-interactive sign-ins where an Entra ID client application authenticates on behalf of a principal user using an application (client) ID that is not commonly associated with that user's historical sign-in behavior. Adversaries with stolen credentials or OAuth tokens may abuse Entra ID–managed or first-party client IDs to perform on-behalf-of (OBO) authentication, blending into legitimate cloud traffic while avoiding traditional interactive sign-in flows. This technique is commonly observed in OAuth phishing, token theft, and access broker operations, and may precede lateral movement, persistence, or data access via Microsoft Graph or other cloud resources. The rule uses a New Terms approach to identify first-seen combinations of the UPN and Client ID within a defined history window, helping surface unexpected client usage that may indicate compromised identities, malicious automation, or unauthorized application impersonation.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2025/03/10"
3integration = ["azure"]
4maturity = "production"
5updated_date = "2026/11/03"
6
7[rule]
8author = ["Elastic"]
9description = """
10Detects rare non-interactive sign-ins where an Entra ID client application authenticates on behalf of a principal user
11using an application (client) ID that is not commonly associated with that user's historical sign-in behavior.
12Adversaries with stolen credentials or OAuth tokens may abuse Entra ID–managed or first-party client IDs to perform
13on-behalf-of (OBO) authentication, blending into legitimate cloud traffic while avoiding traditional interactive sign-in
14flows. This technique is commonly observed in OAuth phishing, token theft, and access broker operations, and may precede
15lateral movement, persistence, or data access via Microsoft Graph or other cloud resources. The rule uses a New Terms
16approach to identify first-seen combinations of the UPN and Client ID within a defined history window, helping surface
17unexpected client usage that may indicate compromised identities, malicious automation, or unauthorized application
18impersonation.
19"""
20from = "now-9m"
21index = ["filebeat-*", "logs-azure.signinlogs-*"]
22language = "kuery"
23license = "Elastic License v2"
24name = "Entra ID User Sign-in with Unusual Client"
25note = """## Triage and analysis
26
27### Investigating Entra ID User Sign-in with Unusual Client
28
29This rule identifies rare Azure Entra apps IDs requesting authentication on-behalf-of a principal user. An adversary with stolen credentials may specify an Azure-managed app ID to authenticate on-behalf-of a user. This is a rare event and may indicate an attempt to bypass conditional access policies (CAP) and multi-factor authentication (MFA) requirements. The app ID specified may not be commonly used by the user based on their historical sign-in activity.
30
31### Possible investigation steps
32
33- Identify the source IP address from which the failed login attempts originated by reviewing `source.ip`. Determine if the IP is associated with known malicious activity using threat intelligence sources or if it belongs to a corporate VPN, proxy, or automation process.
34- Analyze affected user accounts by reviewing `azure.signinlogs.properties.user_principal_name` to determine if they belong to privileged roles or high-value users. Look for patterns indicating multiple failed attempts across different users, which could suggest a password spraying attempt.
35- Examine the authentication method used in `azure.signinlogs.properties.authentication_details` to identify which authentication protocols were attempted and why they failed. Legacy authentication methods may be more susceptible to brute-force attacks.
36- Review the authentication error codes found in `azure.signinlogs.properties.status.error_code` to understand why the login attempts failed. Common errors include `50126` for invalid credentials, `50053` for account lockouts, `50055` for expired passwords, and `50056` for users without a password.
37- Correlate failed logins with other sign-in activity by looking at `event.outcome`. Identify if there were any successful logins from the same user shortly after multiple failures or if there are different geolocations or device fingerprints associated with the same account.
38- Review `azure.signinlogs.properties.app_id` to identify which applications were initiating the authentication attempts. Determine if these applications are Microsoft-owned, third-party, or custom applications and if they are authorized to access the resources.
39- Check for any conditional access policies that may have been triggered by the failed login attempts by reviewing `azure.signinlogs.properties.authentication_requirement`. This can help identify if the failed attempts were due to policy enforcement or misconfiguration.
40
41## False positive analysis
42
43- Automated scripts or applications using non-interactive authentication may trigger this detection, particularly if they rely on legacy authentication protocols recorded in `azure.signinlogs.properties.authentication_protocol`.
44- Corporate proxies or VPNs may cause multiple users to authenticate from the same IP, appearing as repeated failed attempts under `source.ip`.
45- User account lockouts from forgotten passwords or misconfigured applications may show multiple authentication failures in `azure.signinlogs.properties.status.error_code`.
46- Exclude known trusted IPs, such as corporate infrastructure, from alerts by filtering `source.ip`.
47- Exclude known custom applications from `azure.signinlogs.properties.app_id` that are authorized to use non-interactive authentication.
48- Microsoft Feedback Portal UX generates benign first-seen client activity through PRT-based, non-interactive sign-ins and is excluded by application ID.
49- Microsoft Teams routinely requests tokens for its internal Teams Services, IC3 Gateway, Chat Aggregator, and CMD Services resources; these client-resource combinations are excluded.
50- Managed Windows devices routinely request OfficeHome PRTs with Microsoft 365 Copilot scopes through the standard Microsoft 365 desktop client; this combination is excluded.
51- Ignore principals with a history of failed logins due to legitimate reasons, such as expired passwords or account lockouts, by filtering `azure.signinlogs.properties.user_principal_name`.
52- Correlate sign-in failures with password reset events or normal user behavior before triggering an alert.
53
54## Response and remediation
55
56- Block the source IP address in `source.ip` if determined to be malicious.
57- Reset passwords for all affected user accounts listed in `azure.signinlogs.properties.user_principal_name` and enforce stronger password policies.
58- Ensure basic authentication is disabled for all applications using legacy authentication protocols listed in `azure.signinlogs.properties.authentication_protocol`.
59- Enable multi-factor authentication (MFA) for impacted accounts to mitigate credential-based attacks.
60- Review conditional access policies to ensure they are correctly configured to block unauthorized access attempts recorded in `azure.signinlogs.properties.authentication_requirement`.
61- Review Conditional Access policies to enforce risk-based authentication and block unauthorized access attempts recorded in `azure.signinlogs.properties.authentication_requirement`.
62- Implement a zero-trust security model by enforcing least privilege access and continuous authentication.
63- Regularly review and update conditional access policies to ensure they are effective against evolving threats.
64- Restrict the use of legacy authentication protocols by disabling authentication methods listed in `azure.signinlogs.properties.client_app_used`.
65- Regularly audit authentication logs in `azure.signinlogs` to detect abnormal login behavior and ensure early detection of potential attacks.
66- Regularly rotate client credentials and secrets for applications using non-interactive authentication to reduce the risk of credential theft.
67"""
68references = ["https://securityscorecard.com/wp-content/uploads/2025/02/MassiveBotnet-Report_022125_03.pdf"]
69risk_score = 47
70rule_id = "c766bc56-fdca-11ef-b194-f661ea17fbcd"
71severity = "medium"
72tags = [
73 "Domain: Cloud",
74 "Domain: Identity",
75 "Data Source: Azure",
76 "Data Source: Entra ID",
77 "Data Source: Entra ID Sign-In",
78 "Platform: Entra ID",
79 "Use Case: Identity and Access Audit",
80 "Use Case: Threat Detection",
81 "Tactic: Initial Access",
82 "Resources: Investigation Guide",
83 "Noise: High",
84 "Performance: Normal",
85 "Profile: Aggressive",
86 "Rule Type: New Terms",
87]
88timestamp_override = "event.ingested"
89type = "new_terms"
90
91query = '''
92data_stream.dataset: "azure.signinlogs" and event.category: "authentication"
93 and azure.signinlogs.properties.is_interactive: false
94 and azure.signinlogs.properties.user_type: "Member"
95 and not azure.signinlogs.properties.client_app_used: "Browser"
96 and not source.as.organization.name: "MICROSOFT-CORP-MSN-AS-BLOCK"
97 and not azure.signinlogs.properties.app_id: (
98 "1b3c667f-cde3-4090-b60b-3d2abd0117f0" or
99 "26a7ee05-5602-4d76-a7ba-eae8b7b67941" or
100 "4b0964e4-58f1-47f4-a552-e2e1fc56dcd7" or
101 "ecd6b820-32c2-49b6-98a6-444530e5a77a" or
102 "268761a2-03f3-40df-8a8b-c3db24145b6b" or
103 "fc0f3af4-6835-4174-b806-f7db311fd2f3" or
104 "de50c81f-5f80-4771-b66b-cebd28ccdfc1" or
105 "ab9b8c07-8f02-4f72-87fa-80105867a763" or
106 "6f7e0f60-9401-4f5b-98e2-cf15bd5fd5e3" or
107 "d7b530a4-7680-4c23-a8bf-c52c121d2e87" or
108 "52c2e0b5-c7b6-4d11-a89c-21e42bcec444" or
109 "38aa3b87-a06d-4817-b275-7a316988d93b" or
110 "27922004-5251-4030-b22d-91ecd9a37ea4" or
111 "9ba1a5c7-f17a-4de9-a1f1-6178c8d51223" or
112 "cab96880-db5b-4e15-90a7-f3f1d62ffe39" or
113 "3a4d129e-7f50-4e0d-a7fd-033add0a29f4" or
114 "29d9ed98-a469-4536-ade2-f981bc1d605e" or
115 "c0ab8ce9-e9a0-42e7-b064-33d422df41f1" or
116 "9ea1ad79-fdb6-4f9a-8bc3-2b70f96e34c7" or
117 "4813382a-8fa7-425e-ab75-3b753aab3abb" or
118 "08e18876-6177-487e-b8b5-cf950c1e598c" or
119 "0ec893e0-5785-4de6-99da-4ed124e5296c" or
120 "d3590ed6-52b3-4102-aeff-aad2292ab01c" or
121 "0dc2408a-bbc0-4238-871e-13b372f0200f" or
122 "af124e86-4e96-495a-b70a-90f90ab96707" or
123 "e9c51622-460d-4d3d-952d-966a5b1da34c" or
124 "f44b1140-bc5e-48c6-8dc0-5cf5a53c0e34" or
125 "e2ef5054-0287-4db6-afa3-013d96881fd3" or
126 "82864fa0-ed49-4711-8395-a0e6003dca1f" or
127 "60c8bde5-3167-4f92-8fdb-059f6176dc0f" or
128 "5d661950-3475-41cd-a2c3-d671a3162bc1" or
129 "145fc680-eb72-4bcf-b4d5-8277021a1ce8" or
130 "c1c74fed-04c9-4704-80dc-9f79a2e515cb" or
131 "a2760c41-63c9-42b5-8d58-bfa1fd9e2eb3" or
132 "6dec647e-42c4-45a6-8f13-e8250d34e033" or
133 "c98e5057-edde-4666-b301-186a01b4dc58" or
134 "0a31c71e-0abf-4238-add7-b1a24c165dc1" or
135 "a8759234-4b8b-4d94-8c0a-ee1ab73af270" or
136 "dae89220-69ba-4957-a77a-47b78695e883" or
137 "fd5f78f6-a28f-450b-abc7-777f3dbbfcba" or
138 "821caec6-bec3-4542-bead-d3c5fb6b4ef0" or
139 "a40d7d7d-59aa-447e-a655-679a4107e548" or
140 "bed12bc0-3a62-470d-998c-e47546e7b039" or
141 "f4060917-6abe-40d7-baa6-f634c0eda4ac" or
142 "b26aadf8-566f-4478-926f-589f601d9c74" or
143 "1f7f6f43-2f81-429c-8499-293566d0ab0c" or
144 "75f31797-37c9-498e-8dc9-53c16a36afca" or
145 "3e050dd7-7815-46a0-8263-b73168a42c10" or
146 "243c63a3-247d-41c5-9d83-7788c43f1c43" or
147 "75efb5bc-18a1-4e7b-8a66-2ad2503d79c6" or
148 "d32f3b53-b7d7-48df-8d0f-f8bf233b3f1f" or
149 "95de633a-083e-42f5-b444-a4295d8e9314" or
150 "3ff8e6ba-7dc3-4e9e-ba40-ee12b60d6d48" or
151 "871c010f-5e61-4fb1-83ac-98610a7e9110" or
152 "3e62f81e-590b-425b-9531-cad6683656cf" or
153 "8ec6bc83-69c8-4392-8f08-b3c986009232" or
154 "d326c1ce-6cc6-4de2-bebc-4591e5e13ef0" or
155 "dd762716-544d-4aeb-a526-687b73838a22" or
156 "7f8f922d-7ee4-40a6-b435-aad8b84ebde0" or
157 "f8d98a96-0999-43f5-8af3-69971c7bb423" or
158 "aa580612-c342-4ace-9055-8edee43ccb89" or
159 "7f67af8a-fedc-4b08-8b4e-37c4d127b6cf" or
160 "00bf137d-f689-4c5d-83d9-7fc31904a7ea" or
161 "ceb96695-e468-48ba-ba21-35e2a242d396" or
162 "7fba38f4-ec1f-458d-906c-f4e3c4f41335" or
163 "a2a1fecc-b06e-4a1e-95c1-2afd94bcadff" or
164 "15ddab63-ba81-45db-9bb6-6f8bc445c459" or
165 "bc59ab01-8403-45c6-8796-ac3ef710b3e3" or
166 "00000003-0000-0ff1-ce00-000000000000" or
167 "4e291c71-d680-4d0e-9640-0a3358e31177" or
168 "4fb5cc57-dbbc-4cdc-9595-748adff5f414" or
169 "22098786-6e16-43cc-a27d-191a01a1e3b5" or
170 "ebde7daf-df42-4ade-81a4-d67b339b49e9" or
171 "c0d2a505-13b8-4ae0-aa9e-cddd5eab0b12" or
172 "a672d62c-fc7b-4e81-a576-e60dc46e951d" or
173 "0b1df6d3-2deb-44d4-b44b-7101937e0726" or
174 "04f0c124-f2bc-4f59-8241-bf6df9866bbd" or
175 "86f4c005-6582-4559-b6cf-8b3111236736" or
176 "a0a3c1d3-7b82-4010-bdb0-e7048fb8f1fe" or
177 "a187e399-0c36-4b98-8f04-1edc167a0996" or
178 "2d4d3d8e-2be3-4bef-9f87-7875a61c29de" or
179 "c475db56-f463-48d8-931a-cfa7cd642289" or
180 "71a7c376-13e6-4100-968e-92ce98c5d3d2" or
181 "3138fe80-4087-4b04-80a6-8866c738028a" or
182 "e8be65d6-d430-4289-a665-51bf2a194bda" or
183 "bb893c22-978d-4cd4-a6f7-bb6cc0d6e6ce" or
184 "4354e225-50c9-4423-9ece-2d5afd904870"
185 )
186 and not (
187 azure.signinlogs.properties.app_id: "1fec8e78-bce4-4aaf-ab1b-5451cc387264" and
188 azure.signinlogs.properties.resource_id: (
189 "cc15fd57-2c6c-4117-a88c-83b1d56b4bbe" or
190 "39aaf054-81a5-48c7-a4f8-0293012095b9" or
191 "b1379a75-ce5e-4fa3-80c6-89bb39bf646c" or
192 "6bc3b958-689b-49f5-9006-36d165f30e00"
193 )
194 )
195 and not (
196 azure.signinlogs.properties.app_id: "4765445b-32c6-49b0-83e6-1d93765276ca" and
197 azure.signinlogs.properties.resource_id: "4765445b-32c6-49b0-83e6-1d93765276ca" and
198 azure.signinlogs.properties.authentication_processing_details: *M365Copilot.Read.All* and
199 azure.signinlogs.properties.incoming_token_type: "primaryRefreshToken" and
200 azure.signinlogs.properties.client_app_used: "Mobile Apps and Desktop clients" and
201 azure.signinlogs.properties.device_detail.is_managed: true and
202 azure.signinlogs.properties.device_detail.operating_system: "Windows10" and
203 user_agent.original: Mozilla*Edge/18.*
204 )
205'''
206
207
208[[rule.threat]]
209framework = "MITRE ATT&CK"
210
211[[rule.threat.technique]]
212id = "T1078"
213name = "Valid Accounts"
214reference = "https://attack.mitre.org/techniques/T1078/"
215
216[[rule.threat.technique.subtechnique]]
217id = "T1078.004"
218name = "Cloud Accounts"
219reference = "https://attack.mitre.org/techniques/T1078/004/"
220
221[rule.threat.tactic]
222id = "TA0001"
223name = "Initial Access"
224reference = "https://attack.mitre.org/tactics/TA0001/"
225
226[[rule.threat]]
227framework = "MITRE ATT&CK"
228
229[[rule.threat.technique]]
230id = "T1528"
231name = "Steal Application Access Token"
232reference = "https://attack.mitre.org/techniques/T1528/"
233
234[rule.threat.tactic]
235id = "TA0006"
236name = "Credential Access"
237reference = "https://attack.mitre.org/tactics/TA0006/"
238
239[[rule.threat]]
240framework = "MITRE ATT&CK"
241
242[[rule.threat.technique]]
243id = "T1550"
244name = "Use Alternate Authentication Material"
245reference = "https://attack.mitre.org/techniques/T1550/"
246
247[[rule.threat.technique.subtechnique]]
248id = "T1550.001"
249name = "Application Access Token"
250reference = "https://attack.mitre.org/techniques/T1550/001/"
251
252[rule.threat.tactic]
253id = "TA0005"
254name = "Defense Evasion"
255reference = "https://attack.mitre.org/tactics/TA0005/"
256[rule.investigation_fields]
257field_names = [
258 "azure.signinlogs.properties.user_principal_name",
259 "azure.signinlogs.properties.user_id",
260 "azure.signinlogs.properties.app_id",
261 "azure.signinlogs.properties.app_display_name",
262 "azure.signinlogs.properties.client_app_used",
263 "azure.signinlogs.properties.incoming_token_type",
264 "azure.signinlogs.properties.authentication_protocol",
265 "azure.signinlogs.properties.authentication_requirement",
266 "azure.signinlogs.properties.token_issuer_type",
267 "azure.signinlogs.properties.resource_display_name",
268 "source.ip",
269 "source.as.number",
270 "source.geo.country_name",
271 "azure.signinlogs.properties.correlation_id",
272 "azure.signinlogs.properties.session_id",
273]
274
275[rule.new_terms]
276field = "new_terms_fields"
277value = ["azure.signinlogs.properties.user_principal_name", "azure.signinlogs.properties.app_id"]
278[[rule.new_terms.history_window_start]]
279field = "history_window_start"
280value = "now-14d"
Triage and analysis
Investigating Entra ID User Sign-in with Unusual Client
This rule identifies rare Azure Entra apps IDs requesting authentication on-behalf-of a principal user. An adversary with stolen credentials may specify an Azure-managed app ID to authenticate on-behalf-of a user. This is a rare event and may indicate an attempt to bypass conditional access policies (CAP) and multi-factor authentication (MFA) requirements. The app ID specified may not be commonly used by the user based on their historical sign-in activity.
Possible investigation steps
- Identify the source IP address from which the failed login attempts originated by reviewing
source.ip. Determine if the IP is associated with known malicious activity using threat intelligence sources or if it belongs to a corporate VPN, proxy, or automation process. - Analyze affected user accounts by reviewing
azure.signinlogs.properties.user_principal_nameto determine if they belong to privileged roles or high-value users. Look for patterns indicating multiple failed attempts across different users, which could suggest a password spraying attempt. - Examine the authentication method used in
azure.signinlogs.properties.authentication_detailsto identify which authentication protocols were attempted and why they failed. Legacy authentication methods may be more susceptible to brute-force attacks. - Review the authentication error codes found in
azure.signinlogs.properties.status.error_codeto understand why the login attempts failed. Common errors include50126for invalid credentials,50053for account lockouts,50055for expired passwords, and50056for users without a password. - Correlate failed logins with other sign-in activity by looking at
event.outcome. Identify if there were any successful logins from the same user shortly after multiple failures or if there are different geolocations or device fingerprints associated with the same account. - Review
azure.signinlogs.properties.app_idto identify which applications were initiating the authentication attempts. Determine if these applications are Microsoft-owned, third-party, or custom applications and if they are authorized to access the resources. - Check for any conditional access policies that may have been triggered by the failed login attempts by reviewing
azure.signinlogs.properties.authentication_requirement. This can help identify if the failed attempts were due to policy enforcement or misconfiguration.
False positive analysis
- Automated scripts or applications using non-interactive authentication may trigger this detection, particularly if they rely on legacy authentication protocols recorded in
azure.signinlogs.properties.authentication_protocol. - Corporate proxies or VPNs may cause multiple users to authenticate from the same IP, appearing as repeated failed attempts under
source.ip. - User account lockouts from forgotten passwords or misconfigured applications may show multiple authentication failures in
azure.signinlogs.properties.status.error_code. - Exclude known trusted IPs, such as corporate infrastructure, from alerts by filtering
source.ip. - Exclude known custom applications from
azure.signinlogs.properties.app_idthat are authorized to use non-interactive authentication. - Microsoft Feedback Portal UX generates benign first-seen client activity through PRT-based, non-interactive sign-ins and is excluded by application ID.
- Microsoft Teams routinely requests tokens for its internal Teams Services, IC3 Gateway, Chat Aggregator, and CMD Services resources; these client-resource combinations are excluded.
- Managed Windows devices routinely request OfficeHome PRTs with Microsoft 365 Copilot scopes through the standard Microsoft 365 desktop client; this combination is excluded.
- Ignore principals with a history of failed logins due to legitimate reasons, such as expired passwords or account lockouts, by filtering
azure.signinlogs.properties.user_principal_name. - Correlate sign-in failures with password reset events or normal user behavior before triggering an alert.
Response and remediation
- Block the source IP address in
source.ipif determined to be malicious. - Reset passwords for all affected user accounts listed in
azure.signinlogs.properties.user_principal_nameand enforce stronger password policies. - Ensure basic authentication is disabled for all applications using legacy authentication protocols listed in
azure.signinlogs.properties.authentication_protocol. - Enable multi-factor authentication (MFA) for impacted accounts to mitigate credential-based attacks.
- Review conditional access policies to ensure they are correctly configured to block unauthorized access attempts recorded in
azure.signinlogs.properties.authentication_requirement. - Review Conditional Access policies to enforce risk-based authentication and block unauthorized access attempts recorded in
azure.signinlogs.properties.authentication_requirement. - Implement a zero-trust security model by enforcing least privilege access and continuous authentication.
- Regularly review and update conditional access policies to ensure they are effective against evolving threats.
- Restrict the use of legacy authentication protocols by disabling authentication methods listed in
azure.signinlogs.properties.client_app_used. - Regularly audit authentication logs in
azure.signinlogsto detect abnormal login behavior and ensure early detection of potential attacks. - Regularly rotate client credentials and secrets for applications using non-interactive authentication to reduce the risk of credential theft.
References
Related rules
- Entra ID Concurrent Sign-in with Suspicious Properties
- Entra ID Sign-in Brute Force Attempted (Microsoft 365)
- Microsoft Graph Request User Impersonation by Unusual Client
- Entra ID Service Principal with Unusual Source ASN
- Entra ID Actor Token User Impersonation Abuse