← Lab /Security & privacy

Compromised GitHub tokens generate detectable audit-log anomalies

Malicious activity in GitHub can be reliably detected using specific audit-log queries.

Security & privacy Datadog Security Labs 16 Sep 2026 Method Prototype evidence

Published as “Mapping out your unknown: A threat hunter’s guide to GitHub”

Why it matters

Enables security teams to build detection rules for GitHub token compromise and data exfiltration.

Summary

Datadog’s threat hunting team outlines how to use GitHub audit-log events to spot compromised accounts and token abuse. They map MITRE ATT&CK tactics to concrete queries that detect unrecognized device logins, unauthorized OAuth app authorizations, high-volume secret listings, and bulk repository cloning or ZIP downloads. The write-up notes logging quirks that can affect detection, such as missing identity fields on failed requests. They also show how to ingest these logs into Datadog SIEM and create detection rules.

What they found 1

  1. GitHub logs successful sign-ins from unrecognized devices and locations

    “GitHub logs when a user signs in successfully from an unrecognized device and location.”

Caveats 5

  • Attribution to employees can be unreliable; external_identity_nameid is missing from some api.request events.
  • GitHub omits external identity and source IP when a request fails, removing geolocation fields.
  • Token permission fields may reflect the token's own organization, not the target org, leading to misinterpretation.
  • Token metadata can be easy to misread.
  • Repository visibility is expressed by more than one field depending on event type.

What’s new here 4

  • Provides concrete query examples for GitHub audit-log events to detect token abuse, secret enumeration, and data exfiltration.
  • Documents logging inconsistencies (missing external identity, varied visibility fields) that impact detection.
  • Maps GitHub event types to MITRE ATT&CK tactics for structured hunting.
  • Shows integration steps with Datadog Cloud SIEM for automated detection.