Okta Sign-In Events via Third-Party IdP
Detects sign-in events where authentication is carried out via a third-party Identity Provider (IdP) that has not been seen before. Adversaries may add an unauthorized IdP to an Okta tenant to gain persistent access. This rule uses New Terms detection to only alert when a previously unseen IdP is used for authentication, reducing noise from legitimate federated identity providers while highlighting potentially rogue IdP additions.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2023/11/06"
3integration = ["okta"]
4maturity = "production"
5updated_date = "2026/01/09"
6
7[rule]
8author = ["Elastic"]
9description = """
10Detects sign-in events where authentication is carried out via a third-party Identity Provider (IdP) that has not been
11seen before. Adversaries may add an unauthorized IdP to an Okta tenant to gain persistent access. This rule uses New
12Terms detection to only alert when a previously unseen IdP is used for authentication, reducing noise from legitimate
13federated identity providers while highlighting potentially rogue IdP additions.
14"""
15from = "now-9m"
16index = ["logs-okta.system-*"]
17language = "kuery"
18license = "Elastic License v2"
19name = "Okta Sign-In Events via Third-Party IdP"
20note = """## Triage and analysis
21
22### Investigating Okta Sign-In Events via Third-Party IdP
23
24This rule detects sign-in events where authentication is carried out via a third-party Identity Provider (IdP).
25
26Adversaries may attempt to add an unauthorized IdP to an Okta tenant to gain access to the tenant. Following this action, adversaries may attempt to sign in to the tenant using the unauthorized IdP. This rule detects both the addition of an unauthorized IdP and the subsequent sign-in attempt.
27
28#### Possible investigation steps:
29- Identify the third-party IdP by examining the `okta.authentication_context.issuer.id` field.
30- Once the third-party IdP is identified, determine if this IdP is authorized to be used by the tenant.
31- If the IdP is unauthorized, deactivate it immediately via the Okta console.
32- Identify the actor associated with the IdP creation by examining the `okta.actor.id`, `okta.actor.type`, `okta.actor.alternate_id`, and `okta.actor.display_name` fields in historical data.
33 - The `New Okta Identity Provider (IdP) Added by Admin` rule may be helpful in identifying the actor and the IdP creation event.
34- Determine the client used by the actor. Review the `okta.client.ip`, `okta.client.user_agent.raw_user_agent`, `okta.client.zone`, `okta.client.device`, and `okta.client.id` fields.
35- If the client is a device, check the `okta.device.id`, `okta.device.name`, `okta.device.os_platform`, `okta.device.os_version`, and `okta.device.managed` fields.
36- Review the past activities of the actor involved in this action by checking their previous actions logged in the `okta.target` field.
37- Examine the `okta.request.ip_chain` field to potentially determine if the actor used a proxy or VPN to perform this action.
38- Evaluate the actions that happened just before and after this event in the `okta.event_type` field to help understand the full context of the activity.
39
40### False positive analysis:
41- It might be a false positive if this IdP is authorized to be used by the tenant.
42- This may be a false positive if an authorized third-party IdP is used to sign in to the tenant but failures occurred due to an incorrect configuration.
43
44### Response and remediation:
45- If the IdP is unauthorized, deactivate it immediately via the Okta console.
46- Reset the effected user's password and enforce MFA re-enrollment, if applicable.
47- Mobile device forensics may be required to determine if the user's device is compromised.
48- If the IdP is authorized, ensure that the actor who created it is authorized to do so.
49- If the actor is unauthorized, deactivate their account via the Okta console.
50- If the actor is authorized, ensure that the actor's account is not compromised.
51
52- Block the IP address or device used in the attempts if they appear suspicious, using the data from the `okta.client.ip` and `okta.device.id` fields.
53- Conduct a review of Okta policies and ensure they are in accordance with security best practices.
54- If the deactivated IdP was crucial to the organization, consider adding a new IdP and removing the unauthorized IdP.
55
56## Setup
57
58The Okta Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
59"""
60references = [
61 "https://blog.cloudflare.com/cloudflare-investigation-of-the-january-2022-okta-compromise/",
62 "https://www.elastic.co/security-labs/testing-okta-visibility-and-detection-dorothy",
63 "https://sec.okta.com/articles/2023/08/cross-tenant-impersonation-prevention-and-detection",
64 "https://unit42.paloaltonetworks.com/muddled-libra/",
65 "https://www.elastic.co/security-labs/monitoring-okta-threats-with-elastic-security",
66 "https://www.elastic.co/security-labs/starter-guide-to-understanding-okta",
67]
68risk_score = 47
69rule_id = "1ceb05c4-7d25-11ee-9562-f661ea17fbcd"
70severity = "medium"
71tags = [
72 "Domain: Identity",
73 "Use Case: Identity and Access Audit",
74 "Tactic: Initial Access",
75 "Data Source: Okta",
76 "Resources: Investigation Guide",
77]
78timestamp_override = "event.ingested"
79type = "new_terms"
80
81query = '''
82event.dataset: "okta.system"
83 and okta.authentication_context.issuer.id: (* and not "Okta")
84 and (
85 event.action: (
86 "user.authentication.auth_via_IDP"
87 or "user.authentication.auth_via_inbound_SAML"
88 or "user.authentication.auth_via_social"
89 )
90 or (
91 event.action: "user.authentication.auth_via_IDP"
92 and okta.outcome.result: "FAILURE"
93 and okta.outcome.reason: (
94 "A SAML assert with the same ID has already been processed by Okta for a previous request"
95 or "Unable to match transformed username"
96 or "Unable to resolve IdP endpoint"
97 or "Unable to validate SAML Response"
98 or "Unable to validate incoming SAML Assertion"
99 )
100 )
101 )
102'''
103
104[rule.new_terms]
105field = "new_terms_fields"
106value = ["okta.authentication_context.issuer.id"]
107
108[[rule.new_terms.history_window_start]]
109field = "history_window_start"
110value = "now-5d"
111
112[[rule.threat]]
113framework = "MITRE ATT&CK"
114[[rule.threat.technique]]
115id = "T1199"
116name = "Trusted Relationship"
117reference = "https://attack.mitre.org/techniques/T1199/"
118
119
120[rule.threat.tactic]
121id = "TA0001"
122name = "Initial Access"
123reference = "https://attack.mitre.org/tactics/TA0001/"
Triage and analysis
Investigating Okta Sign-In Events via Third-Party IdP
This rule detects sign-in events where authentication is carried out via a third-party Identity Provider (IdP).
Adversaries may attempt to add an unauthorized IdP to an Okta tenant to gain access to the tenant. Following this action, adversaries may attempt to sign in to the tenant using the unauthorized IdP. This rule detects both the addition of an unauthorized IdP and the subsequent sign-in attempt.
Possible investigation steps:
- Identify the third-party IdP by examining the
okta.authentication_context.issuer.idfield. - Once the third-party IdP is identified, determine if this IdP is authorized to be used by the tenant.
- If the IdP is unauthorized, deactivate it immediately via the Okta console.
- Identify the actor associated with the IdP creation by examining the
okta.actor.id,okta.actor.type,okta.actor.alternate_id, andokta.actor.display_namefields in historical data.- The
New Okta Identity Provider (IdP) Added by Adminrule may be helpful in identifying the actor and the IdP creation event.
- The
- Determine the client used by the actor. Review the
okta.client.ip,okta.client.user_agent.raw_user_agent,okta.client.zone,okta.client.device, andokta.client.idfields. - If the client is a device, check the
okta.device.id,okta.device.name,okta.device.os_platform,okta.device.os_version, andokta.device.managedfields. - Review the past activities of the actor involved in this action by checking their previous actions logged in the
okta.targetfield. - Examine the
okta.request.ip_chainfield to potentially determine if the actor used a proxy or VPN to perform this action. - Evaluate the actions that happened just before and after this event in the
okta.event_typefield to help understand the full context of the activity.
False positive analysis:
- It might be a false positive if this IdP is authorized to be used by the tenant.
- This may be a false positive if an authorized third-party IdP is used to sign in to the tenant but failures occurred due to an incorrect configuration.
Response and remediation:
-
If the IdP is unauthorized, deactivate it immediately via the Okta console.
-
Reset the effected user's password and enforce MFA re-enrollment, if applicable.
-
Mobile device forensics may be required to determine if the user's device is compromised.
-
If the IdP is authorized, ensure that the actor who created it is authorized to do so.
-
If the actor is unauthorized, deactivate their account via the Okta console.
-
If the actor is authorized, ensure that the actor's account is not compromised.
-
Block the IP address or device used in the attempts if they appear suspicious, using the data from the
okta.client.ipandokta.device.idfields. -
Conduct a review of Okta policies and ensure they are in accordance with security best practices.
-
If the deactivated IdP was crucial to the organization, consider adding a new IdP and removing the unauthorized IdP.
Setup
The Okta Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
References
Related rules
- Entra ID OAuth User Impersonation to Microsoft Graph
- Entra ID Protection - Risk Detection - Sign-in Risk
- Entra ID Protection - Risk Detection - User Risk
- Entra ID User Sign-in with Unusual Client
- Entra ID OAuth Flow by Microsoft Authentication Broker to Device Registration Service (DRS)