Elastic medium stable kql

OpenAI ChatGPT Enterprise Codex Access Token Created

Detects ChatGPT Enterprise Codex events that create an access token. Codex access tokens enable automated CLI or environment access and can be abused for persistence or lateral automation after account compromise. Treat tokens with a missing `expires_at` as higher priority during triage.

View Source

Detection Logic

from logs-openai_chatgpt_enterprise.codex_log-* metadata _id, _version, _index
| where
    data_stream.dataset == "openai_chatgpt_enterprise.codex_log" and
    event.action == "access_token_created"
| keep
    _id, _version, _index, @timestamp, event.action, user.id, user.email,
    openai_chatgpt_enterprise.codex_log.client_id,
    openai_chatgpt_enterprise.codex_log.event_details.access_token_id,
    openai_chatgpt_enterprise.codex_log.event_details.access_token_name,
    openai_chatgpt_enterprise.codex_log.event_details.created_by_user_id,
    openai_chatgpt_enterprise.codex_log.event_details.expires_at,
    data_stream.*

False Positives

  • ⚠ Developers create Codex tokens for CI runners and local environments.

Field Validations

Loading…

Comments (0)

Loading comments...