heroui logo

GitHub Token Activity from Unusual User Agent

Elastic Detection Rules

View Source
Summary
Identifies the first-time pairing of a GitHub user (user.name) with a given client string (github.user_agent) during token-authenticated activity (git.clone, git.push, repo.download_zip, or api.request). It tracks new user/agent combinations for each user over a 14‑day history and fires when a token is used from an unseen client. The rule covers classic Personal Access Tokens (PAT), Fine‑Grained PATs, and OAuth access tokens. A token that authenticates from a new client is a strong signal of credential theft or replay, as adversaries rarely reproduce the victim’s exact tooling. This detection surfaces broad, first-seen clients (e.g., generic libraries like python-requests, curl) rather than dedicated credential scanners, which are handled by a separate rule. Investigation fields include user.name, github.hashed_token, github.token_id, github.programmatic_access_type, github.user_agent, github.actor_ip, event.action, github.org, github.repo, and github.route to aid triage and determine if the client change is benign or suspicious. The rule integrates with MITRE ATT&CK mappings for Initial Access (T1078/T1078.004), Defense Evasion (T1550.001), and Collection (T1213.003) to contextualize risk. Key triage steps involve verifying token ownership, comparing the new user_agent to known tooling, validating the source IP/geolocation, reviewing the scope of accessed resources, and looking for related activity across the surrounding window. False positives include legitimate tooling changes (CI image upgrades, new git GUIs, library bumps changing User-Agent) and internal automation reusing tokens from new hosts. Remediation actions include revoking the implicated github.hashed_token/github.token_id, rotating affected secrets or deploy keys, resetting the owning user’s credentials if compromise is suspected, and coordinating with repository/organization owners per incident response playbooks when sensitive data may have been exposed.
Categories
  • Cloud
  • Web
  • Application
Data Sources
  • Application Log
  • Web Credential
ATT&CK Techniques
  • T1078
  • T1078.004
  • T1550
  • T1550.001
  • T1213
  • T1213.003
Created: 2026-09-22