Elastic medium stable kql

OpenAI ChatGPT Enterprise Gmail Message Sent via Connector

Detects ChatGPT Enterprise Gmail connector `send_email` responses. Adversaries who abuse a linked Gmail connector after session compromise can exfiltrate data or perform lateral phishing by sending mail on behalf of the user. Draft-only activity (`create_draft`) is excluded.

View Source

Detection Logic

from logs-openai_chatgpt_enterprise.app_log-* metadata _id, _version, _index
| where
    data_stream.dataset == "openai_chatgpt_enterprise.app_log" and
    openai_chatgpt_enterprise.app_log.app_name == "Gmail" and
    openai_chatgpt_enterprise.app_log.app_type == "SERVICE" and
    openai_chatgpt_enterprise.app_log.output is not null
| eval Esql.gmail_action = field_extract(openai_chatgpt_enterprise.app_log.output, "response.action_name")
| where Esql.gmail_action == "send_email"
| keep
    _id, _version, _index, @timestamp, user.id, user.email,
    Esql.gmail_action,
    openai_chatgpt_enterprise.app_log.app_name,
    openai_chatgpt_enterprise.app_log.app_type,
    openai_chatgpt_enterprise.app_log.log_type,
    openai_chatgpt_enterprise.app_log.output,
    data_stream.*

False Positives

  • ⚠ Users legitimately asking ChatGPT to send mail through an approved Gmail connector.

Field Validations

Loading…

Comments (0)

Loading comments...