Detection rules › Sublime MQL

DLP: GitHub Token

Severity
high
Type
dlp
Source
github.com/sublime-security/sublime-rules

Detects messages containing GitHub personal access tokens and OAuth tokens.

Event coverage

Rule body MQL

type.outbound
and any([body.current_thread.text, subject.subject],
        // GitHub personal access token: ghp_, gho_, ghu_, ghs_, ghr_ followed by alphanumeric
        regex.contains(., '\bgh[pousr]_[A-Za-z0-9]{36,}\b')
)

Detection logic

Scope: outbound message.

Detects messages containing GitHub personal access tokens and OAuth tokens.

  1. outbound message
  2. any of [body.current_thread.text, subject.subject] where:
    • . matches '\\bgh[pousr]_[A-Za-z0-9]{36,}\\b'

Inspects: body.current_thread.text, subject.subject, type.outbound. Sensors: regex.contains.

Indicators matched (1)

FieldMatchValue
regex.containsregex\bgh[pousr]_[A-Za-z0-9]{36,}\b