LoFP LoFP / ci, git gui, or library upgrades that change the user-agent on an existing pat or oauth token. confirm the token owner and whether the client is expected.

Techniques

Sample rules

GitHub Token Activity from Unusual User Agent

Description

Identifies the first time a GitHub token is used with a given user agent to perform a clone, push, archive download, or API request. The rule tracks new combinations of user.name and github.user_agent over a 14-day history and covers classic personal access tokens, fine-grained personal access tokens, and OAuth access tokens. A token that suddenly authenticates from a new client is a common indicator of a stolen or misused credential, since an adversary replaying a token rarely reproduces the victim’s original tooling. Named credential scanners such as TruffleHog or Nord Stream are covered by a dedicated rule; this rule surfaces the broader set of first-seen clients, including generic libraries like python-requests.

Detection logic

data_stream.dataset:"github.audit" and event.category:"configuration" and user.name:* and github.user_agent:* and
github.hashed_token:* and
github.programmatic_access_type:("OAuth access token" or "Fine-grained personal access token" or "Personal access token") and
event.action:("git.clone" or "git.push" or "repo.download_zip" or "api.request")