OpenAI ChatGPT Enterprise User Activity From High Number of Countries

Detects ChatGPT Enterprise activity for the same user email from at least three countries and two unique user agents within a four-hour interval across any compliance data stream. Stolen session cookies often produce post-auth activity (conversation views, deletions, downloads) without a new login event, so this rule is not limited to authentication logs.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2026/10/06"
  3integration = ["openai_chatgpt_enterprise"]
  4maturity = "production"
  5updated_date = "2026/10/06"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Detects ChatGPT Enterprise activity for the same user email from at least three countries and two unique user agents
 11within a four-hour interval across any compliance data stream. Stolen session cookies often produce post-auth activity
 12(conversation views, deletions, downloads) without a new login event, so this rule is not limited to authentication
 13logs.
 14"""
 15false_positives = [
 16    "Users on VPN or proxy egress that geo-resolves through multiple regions in a short window.",
 17    "Cloud egress, split-tunnel, or dual-homed clients that present different public IPs for concurrent sessions.",
 18]
 19from = "now-4h"
 20interval = "5m"
 21language = "esql"
 22license = "Elastic License v2"
 23name = "OpenAI ChatGPT Enterprise User Activity From High Number of Countries"
 24note = """## Triage and analysis
 25
 26### Investigating OpenAI ChatGPT Enterprise User Activity From High Number of Countries
 27
 28Activity for the same email spans multiple countries and user agents in a short window across ChatGPT Enterprise compliance streams. That pattern can indicate session reuse, token abuse, or shared-account access through distant egress points, including cases where no new authentication event is logged.
 29
 30Escalate when countries and user agents diverge sharply, the user denies travel or VPN use, or privileged actions appear on distant IPs. Close as a false positive for documented dual-homed VPN or cloud egress with consistent corporate clients.
 31
 32#### Possible investigation steps
 33
 34- Review `Esql.source_geo_country_iso_code_values`, `Esql.source_geo_region_name_values`, and `Esql.user_agent_original_values`.
 35- Compare source IPs and timestamps (`Esql.timestamp_first_seen`, `Esql.timestamp_last_seen`) for physical travel feasibility.
 36- Check for privileged audit actions, downloads, or shares from the distant IPs.
 37- Contact the user only after geo and user-agent triage to confirm expected VPN or travel.
 38
 39### False positive analysis
 40
 41- Split-tunnel, dual-homed, or VPN egress that geo-resolves through multiple regions is the most common false positive. Corroborate with ASN and user-agent consistency before escalating.
 42
 43### Response and remediation
 44
 45- On suspected compromise: force logout, revoke sessions, reset credentials and MFA, and review role changes or exports for the same email after the distant activity.
 46"""
 47references = [
 48    "https://www.elastic.co/docs/reference/integrations/openai_chatgpt_enterprise",
 49    "https://platform.openai.com/docs/compliance",
 50]
 51risk_score = 99
 52rule_id = "d7e01c19-4463-4693-bd98-451875737fc8"
 53setup = """## Setup
 54
 55This rule requires the OpenAI ChatGPT Enterprise integration to collect compliance logs into Elasticsearch.
 56
 57https://www.elastic.co/docs/reference/integrations/openai_chatgpt_enterprise
 58"""
 59severity = "critical"
 60tags = [
 61    "Domain: GenAI",
 62    "Platform: OpenAI",
 63    "Data Source: OpenAI ChatGPT Enterprise",
 64    "Service: OpenAI ChatGPT Enterprise",
 65    "Use Case: Threat Detection",
 66    "Resources: Investigation Guide",
 67    "Rule Type: ES|QL",
 68    "Domain: Identity",
 69    "Use Case: Identity and Access Audit",
 70    "Tactic: Credential Access",
 71    "Tactic: Initial Access",
 72    "Mitre Atlas: AML.T0012",
 73    "Threat: Impossible Travel",
 74]
 75timestamp_override = "event.ingested"
 76type = "esql"
 77
 78query = '''
 79from logs-openai_chatgpt_enterprise.*
 80| where
 81    user.email is not null and
 82    source.ip is not null and
 83    source.geo.country_iso_code is not null
 84| stats
 85    Esql.country_count = count_distinct(source.geo.country_iso_code),
 86    Esql.region_count = count_distinct(source.geo.region_name),
 87    Esql.source_ip_count = count_distinct(source.ip),
 88    Esql.user_agent_count = count_distinct(user_agent.original),
 89    Esql.event_count = count(*),
 90    Esql.event_action_values = values(event.action),
 91    Esql.source_ip_values = values(source.ip),
 92    Esql.source_geo_country_iso_code_values = values(source.geo.country_iso_code),
 93    Esql.source_geo_region_name_values = values(source.geo.region_name),
 94    Esql.source_geo_city_name_values = values(source.geo.city_name),
 95    Esql.user_agent_original_values = values(user_agent.original),
 96    Esql.timestamp_first_seen = min(@timestamp),
 97    Esql.timestamp_last_seen = max(@timestamp)
 98  by user.email
 99| where Esql.country_count >= 3 and Esql.user_agent_count >= 2
100| keep user.email, Esql.*
101'''
102
103
104[[rule.threat]]
105framework = "MITRE ATT&CK"
106[[rule.threat.technique]]
107id = "T1539"
108name = "Steal Web Session Cookie"
109reference = "https://attack.mitre.org/techniques/T1539/"
110
111
112[rule.threat.tactic]
113id = "TA0006"
114name = "Credential Access"
115reference = "https://attack.mitre.org/tactics/TA0006/"
116
117[[rule.threat]]
118framework = "MITRE ATT&CK"
119[[rule.threat.technique]]
120id = "T1078"
121name = "Valid Accounts"
122reference = "https://attack.mitre.org/techniques/T1078/"
123[[rule.threat.technique.subtechnique]]
124id = "T1078.004"
125name = "Cloud Accounts"
126reference = "https://attack.mitre.org/techniques/T1078/004/"
127
128
129[rule.threat.tactic]
130id = "TA0001"
131name = "Initial Access"
132reference = "https://attack.mitre.org/tactics/TA0001/"
133
134[[rule.threat_mappings]]
135framework = "MITRE ATLAS"
136version = "2026.08"
137[[rule.threat_mappings.threat]]
138framework = "MITRE ATLAS"
139[[rule.threat_mappings.threat.technique]]
140id = "AML.T0012"
141name = "Valid Accounts"
142reference = "https://atlas.mitre.org/techniques/AML.T0012/"
143
144
145[rule.threat_mappings.threat.tactic]
146id = "AML.TA0004"
147name = "Initial Access"
148reference = "https://atlas.mitre.org/tactics/AML.TA0004/"
149
150[rule.alert_suppression]
151group_by = ["user.email"]
152missing_fields_strategy = "suppress"
153
154[rule.alert_suppression.duration]
155unit = "h"
156value = 4
157
158[rule.investigation_fields]
159field_names = [
160    "user.email",
161    "Esql.country_count",
162    "Esql.source_ip_count",
163    "Esql.user_agent_count",
164    "Esql.event_count",
165    "Esql.event_action_values",
166    "Esql.source_ip_values",
167    "Esql.source_geo_country_iso_code_values",
168    "Esql.source_geo_region_name_values",
169    "Esql.region_count",
170    "Esql.user_agent_original_values",
171    "Esql.timestamp_first_seen",
172    "Esql.timestamp_last_seen",
173]

Triage and analysis

Investigating OpenAI ChatGPT Enterprise User Activity From High Number of Countries

Activity for the same email spans multiple countries and user agents in a short window across ChatGPT Enterprise compliance streams. That pattern can indicate session reuse, token abuse, or shared-account access through distant egress points, including cases where no new authentication event is logged.

Escalate when countries and user agents diverge sharply, the user denies travel or VPN use, or privileged actions appear on distant IPs. Close as a false positive for documented dual-homed VPN or cloud egress with consistent corporate clients.

Possible investigation steps

  • Review Esql.source_geo_country_iso_code_values, Esql.source_geo_region_name_values, and Esql.user_agent_original_values.
  • Compare source IPs and timestamps (Esql.timestamp_first_seen, Esql.timestamp_last_seen) for physical travel feasibility.
  • Check for privileged audit actions, downloads, or shares from the distant IPs.
  • Contact the user only after geo and user-agent triage to confirm expected VPN or travel.

False positive analysis

  • Split-tunnel, dual-homed, or VPN egress that geo-resolves through multiple regions is the most common false positive. Corroborate with ASN and user-agent consistency before escalating.

Response and remediation

  • On suspected compromise: force logout, revoke sessions, reset credentials and MFA, and review role changes or exports for the same email after the distant activity.

References

Related rules

to-top