OpenAI ChatGPT Enterprise Authentication from a Suspicious User Agent


Description

Detects successful ChatGPT Enterprise authentication events where the user agent looks scripted (for example Python, curl, Go HTTP clients, aiohttp, scrapers, or headless browsers) rather than a normal browser. Adversaries and automation often reuse stolen sessions or tokens with non-browser clients.

Query · esql

from logs-openai_chatgpt_enterprise.auth_log-* metadata _id, _version, _index
| where
    data_stream.dataset == "openai_chatgpt_enterprise.auth_log" and
    event.action in ("login_success", "native_login_success", "token_issued") and
    user_agent.original is not null and
    (
        to_lower(user_agent.original) like "*python*" or
        to_lower(user_agent.original) like "*curl/*" or
        to_lower(user_agent.original) like "*wget*" or
        to_lower(user_agent.original) like "*httpie*" or
        to_lower(user_agent.original) like "*go-http*" or
        to_lower(user_agent.original) like "*aiohttp*" or
        to_lower(user_agent.original) like "*fasthttp*" or
        to_lower(user_agent.original) like "*httpclient*" or
        to_lower(user_agent.original) like "*postmanruntime*" or
        to_lower(user_agent.original) like "*headlesschrome*" or
        to_lower(user_agent.original) like "*phantomjs*" or
        to_lower(user_agent.original) like "*selenium*" or
        to_lower(user_agent.original) like "*okhttp*" or
        to_lower(user_agent.original) like "*scrapy*" or
        to_lower(user_agent.original) like "*hydra*" or
        to_lower(user_agent.original) like "*patator*" or
        to_lower(user_agent.original) like "*metasploit*" or
        to_lower(user_agent.original) like "*curio*" or
        to_lower(user_agent.original) like "*hyper*" or
        to_lower(user_agent.original) like "*kali*" or
        to_lower(user_agent.original) like "ruby*" or
        to_lower(user_agent.original) like "node*" or
        to_lower(user_agent.original) like "undici*" or
        to_lower(user_agent.original) like "java*" or
        to_lower(user_agent.original) like "php*" or
        to_lower(user_agent.original) like "*bun/*" or
        to_lower(user_agent.original) like "*axios*"
    )
| keep _id, _version, _index, @timestamp, event.action, event.outcome, user.email, user.id, source.ip, source.geo.country_iso_code, user_agent.original, data_stream.*

Investigation fields

Pivot points the source recommends for triage.

  • @timestamp
  • event.action
  • user.email
  • user.id
  • source.ip
  • source.geo.country_iso_code
  • user_agent.original

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

  • Approved automation, compliance API tooling, or SSO libraries that use non-browser user agents.

Analyst notes

Investigating OpenAI ChatGPT Enterprise Authentication from a Suspicious User Agent

A successful authentication event used a scripted user agent (for example Python, curl, Go HTTP clients, or similar) rather than a typical browser.

Escalate when the user has no approved CLI or API access, the user agent is unfamiliar, or privileged activity follows the sign-in. Close as a false positive for documented automation, compliance collectors, or SSO libraries that use non-browser clients.

Possible investigation steps

  • Confirm user_agent.original, source.ip, source.geo.country_iso_code, and the authenticated user.
  • Determine whether the account is expected to use CLI, API, or compliance automation.
  • Search for role changes, file downloads, conversation shares, or admin actions from the same user shortly after the event.
  • Compare with the user's normal browser-based authentication history.

False positive analysis

  • Approved automation, compliance API tooling, and some SSO client libraries use non-browser user agents by design.

Response and remediation

  • Revoke sessions for the user, rotate credentials where appropriate, and inventory automation that uses that user agent.
  • If takeover is suspected, review subsequent data-access and admin activity for the same account.
Raw source OpenAI ChatGPT Enterprise Authentication from a Suspicious User Agent · 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"
updated_date = "2026/10/09"

[rule]
author = ["Elastic"]
description = """
Detects successful ChatGPT Enterprise authentication events where the user agent looks scripted (for example Python,
curl, Go HTTP clients, aiohttp, scrapers, or headless browsers) rather than a normal browser. Adversaries and automation
often reuse stolen sessions or tokens with non-browser clients.
"""
false_positives = ["Approved automation, compliance API tooling, or SSO libraries that use non-browser user agents."]
from = "now-9m"
language = "esql"
license = "Elastic License v2"
name = "OpenAI ChatGPT Enterprise Authentication from a Suspicious User Agent"
note = """## Triage and analysis

### Investigating OpenAI ChatGPT Enterprise Authentication from a Suspicious User Agent

A successful authentication event used a scripted user agent (for example Python, curl, Go HTTP clients, or similar) rather than a typical browser.

Escalate when the user has no approved CLI or API access, the user agent is unfamiliar, or privileged activity follows the sign-in. Close as a false positive for documented automation, compliance collectors, or SSO libraries that use non-browser clients.

#### Possible investigation steps

- Confirm `user_agent.original`, `source.ip`, `source.geo.country_iso_code`, and the authenticated user.
- Determine whether the account is expected to use CLI, API, or compliance automation.
- Search for role changes, file downloads, conversation shares, or admin actions from the same user shortly after the event.
- Compare with the user's normal browser-based authentication history.

### False positive analysis

- Approved automation, compliance API tooling, and some SSO client libraries use non-browser user agents by design.

### Response and remediation

- Revoke sessions for the user, rotate credentials where appropriate, and inventory automation that uses that user agent.
- If takeover is suspected, review subsequent data-access and admin activity for the same account.
"""
references = [
    "https://www.elastic.co/docs/reference/integrations/openai_chatgpt_enterprise",
    "https://platform.openai.com/docs/compliance",
]
risk_score = 47
rule_id = "c461f0cf-54df-4e93-bb05-076ea22fe84b"
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 = "medium"
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",
    "Tactic: Initial Access",
    "Mitre Atlas: AML.T0012",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-openai_chatgpt_enterprise.auth_log-* metadata _id, _version, _index
| where
    data_stream.dataset == "openai_chatgpt_enterprise.auth_log" and
    event.action in ("login_success", "native_login_success", "token_issued") and
    user_agent.original is not null and
    (
        to_lower(user_agent.original) like "*python*" or
        to_lower(user_agent.original) like "*curl/*" or
        to_lower(user_agent.original) like "*wget*" or
        to_lower(user_agent.original) like "*httpie*" or
        to_lower(user_agent.original) like "*go-http*" or
        to_lower(user_agent.original) like "*aiohttp*" or
        to_lower(user_agent.original) like "*fasthttp*" or
        to_lower(user_agent.original) like "*httpclient*" or
        to_lower(user_agent.original) like "*postmanruntime*" or
        to_lower(user_agent.original) like "*headlesschrome*" or
        to_lower(user_agent.original) like "*phantomjs*" or
        to_lower(user_agent.original) like "*selenium*" or
        to_lower(user_agent.original) like "*okhttp*" or
        to_lower(user_agent.original) like "*scrapy*" or
        to_lower(user_agent.original) like "*hydra*" or
        to_lower(user_agent.original) like "*patator*" or
        to_lower(user_agent.original) like "*metasploit*" or
        to_lower(user_agent.original) like "*curio*" or
        to_lower(user_agent.original) like "*hyper*" or
        to_lower(user_agent.original) like "*kali*" or
        to_lower(user_agent.original) like "ruby*" or
        to_lower(user_agent.original) like "node*" or
        to_lower(user_agent.original) like "undici*" or
        to_lower(user_agent.original) like "java*" or
        to_lower(user_agent.original) like "php*" or
        to_lower(user_agent.original) like "*bun/*" or
        to_lower(user_agent.original) like "*axios*"
    )
| keep _id, _version, _index, @timestamp, event.action, event.outcome, user.email, user.id, source.ip, source.geo.country_iso_code, user_agent.original, data_stream.*
'''


[[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.investigation_fields]
field_names = [
    "@timestamp",
    "event.action",
    "user.email",
    "user.id",
    "source.ip",
    "source.geo.country_iso_code",
    "user_agent.original",
]

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.