OpenAI ChatGPT Enterprise Impossible Travel Login


Description

Detects successful ChatGPT Enterprise logins for the same user email from source IPs whose geo-locations are separated by at least 1,000 km, with implied travel faster than 800 km/h, within a 24-hour window. That pattern can indicate account sharing, VPN or proxy egress mismatches, or an adversary authenticating from a geography far from the legitimate user's baseline.

Query · esql

from logs-openai_chatgpt_enterprise.auth_log-*
| where
    data_stream.dataset == "openai_chatgpt_enterprise.auth_log" and
    event.action in ("login_success", "native_login_success") and
    user.email is not null and
    source.ip is not null and
    source.geo.location is not null and
    source.geo.country_iso_code is not null
| eval
    Esql.source_geo_lat = st_y(source.geo.location),
    Esql.source_geo_lon = st_x(source.geo.location)
| where Esql.source_geo_lat is not null and Esql.source_geo_lon is not null
| stats
    Esql.first_lat = first(Esql.source_geo_lat, @timestamp),
    Esql.first_lon = first(Esql.source_geo_lon, @timestamp),
    Esql.last_lat = last(Esql.source_geo_lat, @timestamp),
    Esql.last_lon = last(Esql.source_geo_lon, @timestamp),
    Esql.event_count = count(*),
    Esql.country_count = count_distinct(source.geo.country_iso_code),
    Esql.event_action_values = values(event.action),
    Esql.source_ip_values = values(source.ip),
    Esql.source_geo_country_iso_code_values = values(source.geo.country_iso_code),
    Esql.source_geo_region_name_values = values(source.geo.region_name),
    Esql.source_geo_city_name_values = values(source.geo.city_name),
    Esql.user_agent_original_values = values(user_agent.original),
    Esql.timestamp_first_seen = min(@timestamp),
    Esql.timestamp_last_seen = max(@timestamp)
  by user.email
| where Esql.event_count >= 2 and Esql.country_count >= 2
| eval
    Esql.p1 = to_geopoint(concat("POINT(", to_string(Esql.first_lon), " ", to_string(Esql.first_lat), ")")),
    Esql.p2 = to_geopoint(concat("POINT(", to_string(Esql.last_lon), " ", to_string(Esql.last_lat), ")"))
| eval
    Esql.distance_km = round(st_distance(Esql.p1, Esql.p2) / 1000.0, 0),
    Esql.window_minutes = date_diff("minute", Esql.timestamp_first_seen, Esql.timestamp_last_seen),
    Esql.travel_kmh = case(Esql.window_minutes > 0, round(Esql.distance_km * 60.0 / Esql.window_minutes, 0), null)
| where Esql.distance_km >= 1000 and Esql.travel_kmh >= 800
| keep user.email, Esql.*

Investigation fields

Pivot points the source recommends for triage.

  • user.email
  • Esql.distance_km
  • Esql.travel_kmh
  • Esql.window_minutes
  • Esql.event_count
  • Esql.country_count
  • Esql.source_ip_values
  • Esql.source_geo_country_iso_code_values
  • Esql.source_geo_region_name_values
  • Esql.source_geo_city_name_values
  • Esql.user_agent_original_values
  • Esql.timestamp_first_seen
  • Esql.timestamp_last_seen

Implementation guide

This rule requires the OpenAI ChatGPT Enterprise integration to collect compliance logs into Elasticsearch.

https://www.elastic.co/docs/reference/integrations/openai_chatgpt_enterprise

Known false positives

  • Users on VPN or proxy egress that geo-resolves through a region distant from the user physical location.
  • Mobile clients on cellular networks that peer through regional hubs may geo-resolve differently than the user location.

Analyst notes

Investigating OpenAI ChatGPT Enterprise Impossible Travel Login

Two successful ChatGPT Enterprise logins for the same user.email appear too far apart, too quickly, to be physical travel. That can indicate account sharing, VPN or proxy geo mismatch, or adversary authentication from a distant egress.

Note: this detection compares the first and last successful login locations in the lookback window. An A-B-A return to the original location can under-report distance, so always timeline-sort raw authentication events before concluding.

Escalate when the distant IP or user agent is unfamiliar, the user denies travel or VPN use, or privileged activity follows the distant sign-in. Close as a false positive when the user confirms known travel, split home and office VPN use, or geo-database noise with matching corporate clients.

Possible investigation steps

  • Review Esql.distance_km, Esql.travel_kmh, Esql.window_minutes, and the geo and IP value lists.
  • Timeline-sort successful logins and compare each source.ip, geo region, and user_agent.original.
  • Pair with multi-country authentication activity or privileged audit actions after the distant sign-in.
  • Contact the user only after geo and user-agent triage.

False positive analysis

  • VPN pools and anycast or satellite geo misplacements commonly inflate implied travel speed. Corroborate with ASN and user agent before escalating.

Response and remediation

  • On suspected compromise: revoke sessions, reset credentials and MFA, and review admin or data-access activity after the distant sign-in.
Raw source OpenAI ChatGPT Enterprise Impossible Travel Login · Elastic TOML
Esc
Published by elastic/detection-rules ↗, licensed under Elastic License 2.0 ↗. Reproduced here unmodified.
[metadata]
creation_date = "2026/10/06"
integration = ["openai_chatgpt_enterprise"]
maturity = "production"
min_stack_comments = "ES|QL FIRST/LAST aggregations and st_distance require 9.4.0+."
min_stack_version = "9.4.0"
updated_date = "2026/10/06"

[rule]
author = ["Elastic"]
description = """
Detects successful ChatGPT Enterprise logins for the same user email from source IPs whose geo-locations are
separated by at least 1,000 km, with implied travel faster than 800 km/h, within a 24-hour window. That pattern can
indicate account sharing, VPN or proxy egress mismatches, or an adversary authenticating from a geography far from
the legitimate user's baseline.
"""
false_positives = [
    "Users on VPN or proxy egress that geo-resolves through a region distant from the user physical location.",
    "Mobile clients on cellular networks that peer through regional hubs may geo-resolve differently than the user location.",
]
from = "now-24h"
interval = "1h"
language = "esql"
license = "Elastic License v2"
name = "OpenAI ChatGPT Enterprise Impossible Travel Login"
note = """## Triage and analysis

### Investigating OpenAI ChatGPT Enterprise Impossible Travel Login

Two successful ChatGPT Enterprise logins for the same `user.email` appear too far apart, too quickly, to be physical travel. That can indicate account sharing, VPN or proxy geo mismatch, or adversary authentication from a distant egress.

Note: this detection compares the first and last successful login locations in the lookback window. An A-B-A return to the original location can under-report distance, so always timeline-sort raw authentication events before concluding.

Escalate when the distant IP or user agent is unfamiliar, the user denies travel or VPN use, or privileged activity follows the distant sign-in. Close as a false positive when the user confirms known travel, split home and office VPN use, or geo-database noise with matching corporate clients.

#### Possible investigation steps

- Review `Esql.distance_km`, `Esql.travel_kmh`, `Esql.window_minutes`, and the geo and IP value lists.
- Timeline-sort successful logins and compare each `source.ip`, geo region, and `user_agent.original`.
- Pair with multi-country authentication activity or privileged audit actions after the distant sign-in.
- Contact the user only after geo and user-agent triage.

### False positive analysis

- VPN pools and anycast or satellite geo misplacements commonly inflate implied travel speed. Corroborate with ASN and user agent before escalating.

### Response and remediation

- On suspected compromise: revoke sessions, reset credentials and MFA, and review admin or data-access activity after the distant sign-in.
"""
references = [
    "https://www.elastic.co/docs/reference/integrations/openai_chatgpt_enterprise",
    "https://platform.openai.com/docs/compliance",
]
risk_score = 73
rule_id = "b9e509ba-ca0f-450a-8577-0b0a1098d598"
setup = """## Setup

This rule requires the OpenAI ChatGPT Enterprise integration to collect compliance logs into Elasticsearch.

https://www.elastic.co/docs/reference/integrations/openai_chatgpt_enterprise
"""
severity = "high"
tags = [
    "Domain: GenAI",
    "Platform: OpenAI",
    "Data Source: OpenAI ChatGPT Enterprise",
    "Service: OpenAI ChatGPT Enterprise",
    "Use Case: Threat Detection",
    "Resources: Investigation Guide",
    "Rule Type: ES|QL",
    "Domain: Identity",
    "Use Case: Identity and Access Audit",
    "Tactic: Initial Access",
    "Mitre Atlas: AML.T0012",
    "Threat: Impossible Travel",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-openai_chatgpt_enterprise.auth_log-*
| where
    data_stream.dataset == "openai_chatgpt_enterprise.auth_log" and
    event.action in ("login_success", "native_login_success") and
    user.email is not null and
    source.ip is not null and
    source.geo.location is not null and
    source.geo.country_iso_code is not null
| eval
    Esql.source_geo_lat = st_y(source.geo.location),
    Esql.source_geo_lon = st_x(source.geo.location)
| where Esql.source_geo_lat is not null and Esql.source_geo_lon is not null
| stats
    Esql.first_lat = first(Esql.source_geo_lat, @timestamp),
    Esql.first_lon = first(Esql.source_geo_lon, @timestamp),
    Esql.last_lat = last(Esql.source_geo_lat, @timestamp),
    Esql.last_lon = last(Esql.source_geo_lon, @timestamp),
    Esql.event_count = count(*),
    Esql.country_count = count_distinct(source.geo.country_iso_code),
    Esql.event_action_values = values(event.action),
    Esql.source_ip_values = values(source.ip),
    Esql.source_geo_country_iso_code_values = values(source.geo.country_iso_code),
    Esql.source_geo_region_name_values = values(source.geo.region_name),
    Esql.source_geo_city_name_values = values(source.geo.city_name),
    Esql.user_agent_original_values = values(user_agent.original),
    Esql.timestamp_first_seen = min(@timestamp),
    Esql.timestamp_last_seen = max(@timestamp)
  by user.email
| where Esql.event_count >= 2 and Esql.country_count >= 2
| eval
    Esql.p1 = to_geopoint(concat("POINT(", to_string(Esql.first_lon), " ", to_string(Esql.first_lat), ")")),
    Esql.p2 = to_geopoint(concat("POINT(", to_string(Esql.last_lon), " ", to_string(Esql.last_lat), ")"))
| eval
    Esql.distance_km = round(st_distance(Esql.p1, Esql.p2) / 1000.0, 0),
    Esql.window_minutes = date_diff("minute", Esql.timestamp_first_seen, Esql.timestamp_last_seen),
    Esql.travel_kmh = case(Esql.window_minutes > 0, round(Esql.distance_km * 60.0 / Esql.window_minutes, 0), null)
| where Esql.distance_km >= 1000 and Esql.travel_kmh >= 800
| keep user.email, Esql.*
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique.subtechnique]]
id = "T1078.004"
name = "Cloud Accounts"
reference = "https://attack.mitre.org/techniques/T1078/004/"


[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"

[[rule.threat_mappings]]
framework = "MITRE ATLAS"
version = "2026.08"
[[rule.threat_mappings.threat]]
framework = "MITRE ATLAS"
[[rule.threat_mappings.threat.technique]]
id = "AML.T0012"
name = "Valid Accounts"
reference = "https://atlas.mitre.org/techniques/AML.T0012/"


[rule.threat_mappings.threat.tactic]
id = "AML.TA0004"
name = "Initial Access"
reference = "https://atlas.mitre.org/tactics/AML.TA0004/"

[rule.alert_suppression]
group_by = ["user.email"]
missing_fields_strategy = "suppress"

[rule.alert_suppression.duration]
unit = "h"
value = 24

[rule.investigation_fields]
field_names = [
    "user.email",
    "Esql.distance_km",
    "Esql.travel_kmh",
    "Esql.window_minutes",
    "Esql.event_count",
    "Esql.country_count",
    "Esql.source_ip_values",
    "Esql.source_geo_country_iso_code_values",
    "Esql.source_geo_region_name_values",
    "Esql.source_geo_city_name_values",
    "Esql.user_agent_original_values",
    "Esql.timestamp_first_seen",
    "Esql.timestamp_last_seen",
]

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.