Unusual ROPC Login Attempt by User Principal
Detects unusual resource owner password credential (ROPC) login attempts by a user principal in Microsoft Entra ID. ROPC is a legacy authentication flow that allows applications to obtain tokens by directly providing user credentials. This method is less secure and can be exploited by adversaries to gain access to user accounts without requiring multi-factor authentication (MFA), especially during enumeration or password spraying. This is a New Terms rule that identifies when user principals are involved in ROPC login attempts, not seen before in the last 10 days, indicating potential abuse or unusual activity.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2025/07/02"
3integration = ["azure"]
4maturity = "production"
5updated_date = "2025/07/02"
6
7[rule]
8author = ["Elastic"]
9description = """
10Detects unusual resource owner password credential (ROPC) login attempts by a user principal in Microsoft Entra ID. ROPC
11is a legacy authentication flow that allows applications to obtain tokens by directly providing user credentials. This
12method is less secure and can be exploited by adversaries to gain access to user accounts without requiring multi-factor
13authentication (MFA), especially during enumeration or password spraying. This is a New Terms rule that identifies when
14user principals are involved in ROPC login attempts, not seen before in the last 10 days, indicating potential abuse or
15unusual activity.
16"""
17from = "now-9m"
18index = ["filebeat-*", "logs-azure.signinlogs-*"]
19language = "kuery"
20license = "Elastic License v2"
21name = "Unusual ROPC Login Attempt by User Principal"
22note = """## Triage and analysis
23
24### Investigating Unusual ROPC Login Attempt by User Principal
25
26This rule detects unusual login attempts using the Resource Owner Password Credentials (ROPC) flow in Microsoft Entra ID. ROPC allows applications to obtain tokens by directly providing user credentials, bypassing multi-factor authentication (MFA). This method is less secure and can be exploited by adversaries to gain access to user accounts, especially during enumeration or password spraying.
27
28### Possible investigation steps
29- Review the `azure.signinlogs.properties.user_principal_name` field to identify the user principal involved in the ROPC login attempt. Check if this user is expected to use ROPC or if it is an unusual account for this type of authentication.
30- Analyze the `azure.signinlogs.properties.authentication_protocol` field to confirm that the authentication protocol is indeed ROPC. This protocol is typically used in legacy applications or scripts that do not support modern authentication methods.
31- Check the `user_agent.original` field to identify potentially abused open-source tools or scripts that may be using ROPC for unauthorized access such as TeamFiltration or other enumeration tools.
32- Review the `azure.signinlogs.properties.app_display_name` or `azure.signinlogs.properties.app_id` to determine which application is attempting the ROPC login. FOCI applications are commonly used for enumeration and password spraying.
33- Investigate the `azure.signinlogs.properties.client_ip` to identify the source of the login attempt. Check if the IP address is associated with known malicious activity or if it is a legitimate user location.
34- Review the `azure.signinlogs.properties.authentication_details` field for any additional context on the authentication attempt, such as whether it was successful or if there were any errors.
35- Examine the `azure.signinlogs.properties.applied_conditional_access_policies` to see if any conditional access policies were applied during the login attempt. If no policies were applied, this could indicate a potential bypass of security controls.
36- Identify the resource requested access to by checking the `azure.signinlogs.properties.resource_display_name` or `azure.signinlogs.properties.resource_id`. This can help determine if the login attempt was targeting sensitive resources or applications such as Exchange Online, SharePoint, or Teams.
37
38### False positive analysis
39- Legitimate applications or scripts that use ROPC for automation purposes may trigger this rule.
40- Some legacy applications may still rely on ROPC for authentication, especially in environments where modern authentication methods are not fully implemented.
41- Internal security tools or scripts that perform automated tasks using ROPC may generate false positives if they are not properly whitelisted or excluded from the rule.
42
43### Response and remediation
44- If the ROPC login attempt is confirmed to be malicious, immediately block the user account and reset the password to prevent further unauthorized access.
45- Consider enforcing multi-factor authentication (MFA) for the user account to enhance security and prevent future unauthorized access attempts.
46- Review and update conditional access policies to restrict the use of ROPC for sensitive accounts or applications, ensuring that MFA is required for all login attempts.
47- Investigate the source of the ROPC login attempt, including the application and IP address, to determine if there are any additional indicators of compromise or ongoing malicious activity.
48- Monitor the user account and related resources for any further suspicious activity or unauthorized access attempts, and take appropriate actions to mitigate any risks identified.
49- Educate users about the risks associated with ROPC and encourage them to use more secure authentication methods, such as OAuth 2.0 or OpenID Connect, whenever possible.
50"""
51references = [
52 "https://www.proofpoint.com/us/blog/threat-insight/attackers-unleash-teamfiltration-account-takeover-campaign",
53 "https://dirkjanm.io/assets/raw/Finding%20Entra%20ID%20CA%20Bypasses%20-%20the%20structured%20way.pdf",
54 "https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth-ropc",
55]
56risk_score = 47
57rule_id = "8d696bd0-5756-11f0-8e3b-f661ea17fbcd"
58severity = "medium"
59tags = [
60 "Domain: Cloud",
61 "Domain: Identity",
62 "Data Source: Azure",
63 "Data Source: Microsoft Entra ID",
64 "Data Source: Microsoft Entra ID Sign-In Logs",
65 "Use Case: Identity and Access Audit",
66 "Tactic: Initial Access",
67 "Resources: Investigation Guide",
68]
69timestamp_override = "event.ingested"
70type = "new_terms"
71
72query = '''
73event.dataset: "azure.signinlogs" and
74 azure.signinlogs.properties.authentication_protocol: "ropc" and
75 azure.signinlogs.properties.authentication_requirement: "singleFactorAuthentication" and
76 azure.signinlogs.properties.user_type: "Member" and
77 event.outcome: "success"
78'''
79
80
81[[rule.threat]]
82framework = "MITRE ATT&CK"
83[[rule.threat.technique]]
84id = "T1078"
85name = "Valid Accounts"
86reference = "https://attack.mitre.org/techniques/T1078/"
87[[rule.threat.technique.subtechnique]]
88id = "T1078.004"
89name = "Cloud Accounts"
90reference = "https://attack.mitre.org/techniques/T1078/004/"
91
92
93
94[rule.threat.tactic]
95id = "TA0001"
96name = "Initial Access"
97reference = "https://attack.mitre.org/tactics/TA0001/"
98
99[rule.new_terms]
100field = "new_terms_fields"
101value = ["azure.signinlogs.properties.user_principal_name"]
102[[rule.new_terms.history_window_start]]
103field = "history_window_start"
104value = "now-10d"
Triage and analysis
Investigating Unusual ROPC Login Attempt by User Principal
This rule detects unusual login attempts using the Resource Owner Password Credentials (ROPC) flow in Microsoft Entra ID. ROPC allows applications to obtain tokens by directly providing user credentials, bypassing multi-factor authentication (MFA). This method is less secure and can be exploited by adversaries to gain access to user accounts, especially during enumeration or password spraying.
Possible investigation steps
- Review the
azure.signinlogs.properties.user_principal_name
field to identify the user principal involved in the ROPC login attempt. Check if this user is expected to use ROPC or if it is an unusual account for this type of authentication. - Analyze the
azure.signinlogs.properties.authentication_protocol
field to confirm that the authentication protocol is indeed ROPC. This protocol is typically used in legacy applications or scripts that do not support modern authentication methods. - Check the
user_agent.original
field to identify potentially abused open-source tools or scripts that may be using ROPC for unauthorized access such as TeamFiltration or other enumeration tools. - Review the
azure.signinlogs.properties.app_display_name
orazure.signinlogs.properties.app_id
to determine which application is attempting the ROPC login. FOCI applications are commonly used for enumeration and password spraying. - Investigate the
azure.signinlogs.properties.client_ip
to identify the source of the login attempt. Check if the IP address is associated with known malicious activity or if it is a legitimate user location. - Review the
azure.signinlogs.properties.authentication_details
field for any additional context on the authentication attempt, such as whether it was successful or if there were any errors. - Examine the
azure.signinlogs.properties.applied_conditional_access_policies
to see if any conditional access policies were applied during the login attempt. If no policies were applied, this could indicate a potential bypass of security controls. - Identify the resource requested access to by checking the
azure.signinlogs.properties.resource_display_name
orazure.signinlogs.properties.resource_id
. This can help determine if the login attempt was targeting sensitive resources or applications such as Exchange Online, SharePoint, or Teams.
False positive analysis
- Legitimate applications or scripts that use ROPC for automation purposes may trigger this rule.
- Some legacy applications may still rely on ROPC for authentication, especially in environments where modern authentication methods are not fully implemented.
- Internal security tools or scripts that perform automated tasks using ROPC may generate false positives if they are not properly whitelisted or excluded from the rule.
Response and remediation
- If the ROPC login attempt is confirmed to be malicious, immediately block the user account and reset the password to prevent further unauthorized access.
- Consider enforcing multi-factor authentication (MFA) for the user account to enhance security and prevent future unauthorized access attempts.
- Review and update conditional access policies to restrict the use of ROPC for sensitive accounts or applications, ensuring that MFA is required for all login attempts.
- Investigate the source of the ROPC login attempt, including the application and IP address, to determine if there are any additional indicators of compromise or ongoing malicious activity.
- Monitor the user account and related resources for any further suspicious activity or unauthorized access attempts, and take appropriate actions to mitigate any risks identified.
- Educate users about the risks associated with ROPC and encourage them to use more secure authentication methods, such as OAuth 2.0 or OpenID Connect, whenever possible.
References
Related rules
- Entra ID RT to PRT Transition from Same User and Device
- Suspicious ADRS Token Request by Microsoft Auth Broker
- Microsoft Entra ID Suspicious Cloud Device Registration
- Microsoft Entra ID High Risk Sign-in
- Microsoft Entra ID OAuth Phishing via Visual Studio Code Client