First Occurrence of Okta User Session Started via Proxy

Identifies the first occurrence of an Okta user session started via a proxy.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2023/11/07"
 3integration = ["okta"]
 4maturity = "production"
 5updated_date = "2024/12/09"
 6min_stack_version = "8.15.0"
 7min_stack_comments = "Breaking change at 8.15.0 for the Okta Integration."
 8
 9[rule]
10author = ["Elastic"]
11description = "Identifies the first occurrence of an Okta user session started via a proxy."
12index = ["filebeat-*", "logs-okta*"]
13language = "kuery"
14license = "Elastic License v2"
15name = "First Occurrence of Okta User Session Started via Proxy"
16note = """## Triage and analysis
17
18### Investigating First Occurrence of Okta User Session Started via Proxy
19
20This rule detects the first occurrence of an Okta user session started via a proxy. This rule is designed to help identify suspicious authentication behavior that may be indicative of an attacker attempting to gain access to an Okta account while remaining anonymous. This rule leverages the New Terms rule type feature where the `okta.actor.id` value is checked against the previous 7 days of data to determine if the value has been seen before for this activity.
21
22#### Possible investigation steps:
23- Identify the user involved in this action by examining the `okta.actor.id`, `okta.actor.type`, `okta.actor.alternate_id`, and `okta.actor.display_name` fields.
24- 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.
25- Examine the `okta.debug_context.debug_data.flattened` field for more information about the proxy used.
26- Review the `okta.request.ip_chain` field for more information about the geographic location of the proxy.
27- Review the past activities of the actor involved in this action by checking their previous actions.
28- 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.
29
30### False positive analysis:
31- A user may have legitimately started a session via a proxy for security or privacy reasons.
32
33### Response and remediation:
34- Review the profile of the user involved in this action to determine if proxy usage may be expected.
35- If the user is legitimate and the authentication behavior is not suspicious, no action is required.
36- If the user is legitimate but the authentication behavior is suspicious, consider resetting the user's password and enabling multi-factor authentication (MFA).
37    - If MFA is already enabled, consider resetting MFA for the user.
38- If the user is not legitimate, consider deactivating the user's account.
39- Conduct a review of Okta policies and ensure they are in accordance with security best practices.
40
41## Setup
42The Okta Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.
43"""
44references = [
45    "https://developer.okta.com/docs/reference/api/system-log/",
46    "https://developer.okta.com/docs/reference/api/event-types/",
47    "https://developer.okta.com/docs/reference/api/system-log/#issuer-object",
48    "https://www.elastic.co/security-labs/testing-okta-visibility-and-detection-dorothy",
49    "https://sec.okta.com/articles/2023/08/cross-tenant-impersonation-prevention-and-detection",
50    "https://www.elastic.co/security-labs/monitoring-okta-threats-with-elastic-security",
51    "https://www.elastic.co/security-labs/starter-guide-to-understanding-okta",
52]
53risk_score = 47
54rule_id = "6f1bb4b2-7dc8-11ee-92b2-f661ea17fbcd"
55severity = "medium"
56tags = ["Tactic: Initial Access", "Use Case: Identity and Access Audit", "Data Source: Okta"]
57timestamp_override = "event.ingested"
58type = "new_terms"
59
60query = '''
61event.dataset:okta.system and okta.event_type: (user.session.start or user.authentication.verify) and okta.security_context.is_proxy:true and not okta.actor.id: okta*
62'''
63
64
65[[rule.threat]]
66framework = "MITRE ATT&CK"
67[[rule.threat.technique]]
68id = "T1133"
69name = "External Remote Services"
70reference = "https://attack.mitre.org/techniques/T1133/"
71
72
73[rule.threat.tactic]
74id = "TA0001"
75name = "Initial Access"
76reference = "https://attack.mitre.org/tactics/TA0001/"
77
78[rule.new_terms]
79field = "new_terms_fields"
80value = ["okta.actor.id", "cloud.account.id"]
81[[rule.new_terms.history_window_start]]
82field = "history_window_start"
83value = "now-7d"

Triage and analysis

Investigating First Occurrence of Okta User Session Started via Proxy

This rule detects the first occurrence of an Okta user session started via a proxy. This rule is designed to help identify suspicious authentication behavior that may be indicative of an attacker attempting to gain access to an Okta account while remaining anonymous. This rule leverages the New Terms rule type feature where the okta.actor.id value is checked against the previous 7 days of data to determine if the value has been seen before for this activity.

Possible investigation steps:

  • Identify the user involved in this action by examining the okta.actor.id, okta.actor.type, okta.actor.alternate_id, and okta.actor.display_name fields.
  • 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.
  • Examine the okta.debug_context.debug_data.flattened field for more information about the proxy used.
  • Review the okta.request.ip_chain field for more information about the geographic location of the proxy.
  • Review the past activities of the actor involved in this action by checking their previous actions.
  • 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.

False positive analysis:

  • A user may have legitimately started a session via a proxy for security or privacy reasons.

Response and remediation:

  • Review the profile of the user involved in this action to determine if proxy usage may be expected.
  • If the user is legitimate and the authentication behavior is not suspicious, no action is required.
  • If the user is legitimate but the authentication behavior is suspicious, consider resetting the user's password and enabling multi-factor authentication (MFA).
    • If MFA is already enabled, consider resetting MFA for the user.
  • If the user is not legitimate, consider deactivating the user's account.
  • Conduct a review of Okta policies and ensure they are in accordance with security best practices.

Setup

The Okta Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.

References

Related rules

to-top