GitHub Activity from Credential Scanner User Agent
Description
Identifies GitHub audit activity from a user agent associated with credential-scanning and secret-harvesting tooling such as TruffleHog or Nord Stream. These tools walk repository contents and API routes to locate hardcoded secrets, tokens, deploy keys, and other credentials. Legitimate users rarely drive GitHub API traffic with these user agents, so a match is a strong signal that an adversary or an unsanctioned scan is mining the organization for exposed credentials, frequently as a precursor to credential access and data collection from code repositories.
Query · esql
from logs-github.audit-* metadata _id, _index, _version
| where
event.module == "github" and data_stream.dataset == "github.audit" and
(
TO_LOWER(github.user_agent) LIKE "*trufflehog*" or
TO_LOWER(github.user_agent) LIKE "*nord-stream*" or
TO_LOWER(github.user_agent) LIKE "*nordstream*"
)
| keep
_id,
_index,
_version,
@timestamp,
event.action,
user.name,
github.org,
github.repo,
github.route,
github.actor_ip,
github.hashed_token,
github.programmatic_access_type,
github.user_agent
Investigation fields
Pivot points the source recommends for triage.
@timestampevent.actionuser.namegithub.orggithub.repogithub.routegithub.actor_ipgithub.hashed_tokengithub.programmatic_access_typegithub.user_agent
Known false positives
- Authorized secret-scanning jobs that identify as TruffleHog in CI. Restrict exceptions to known automation identities and repositories.
Analyst notes
Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
Investigating GitHub Activity from Credential Scanner User Agent
TruffleHog, Nord Stream, and similar credential scanners identify themselves in the github.user_agent string when they call the GitHub API. This rule matches those user agents across GitHub audit events, so an alert means a client advertising a known secret-harvesting tool interacted with your organization. The matching activity is typically a burst of API requests against secrets, contents, and repository routes as the tool walks the organization looking for exposed tokens and keys. Review the authenticating identity (user.name), the source address (github.actor_ip), the token used (github.hashed_token and github.programmatic_access_type), and the repositories and routes touched (github.org, github.repo, github.route) to determine whether this is a sanctioned scan or an adversary mining for credentials.
Possible investigation steps
- Review
github.user_agentto confirm which scanning tool was advertised, and whether it maps to any sanctioned CI job or security automation in your environment. - Identify the actor using
user.nameandgithub.actor_ip, and determine whether the source IP and its ASN are expected for that user. - Examine the token via
github.hashed_tokenandgithub.programmatic_access_typeto establish whether a PAT, OAuth grant, or GitHub App installation token was used, and who owns it. - Review
github.org,github.repo, andgithub.routeto see which repositories and API routes were enumerated, focusing on secrets, contents, and public-key routes. - Pivot on the same actor or token for follow-on
secret_scanning_alert.create, clone (git.clone), or archive download (repo.download_zip) events that indicate the scan progressed to collection or exfiltration.
False positive analysis
- Authorized secret-scanning jobs that run TruffleHog or similar tools in CI and keep the default user agent. Confirm the identity and source against known automation, and scope exceptions to the specific
user.nameand repository values rather than the user agent alone. - Security team assessments or red-team exercises that use these tools with prior approval. Validate against change-management or engagement records before dismissing.
Response and remediation
- Revoke the token identified by
github.hashed_tokenand require the owning user to reauthenticate. - Rotate any secrets, deploy keys, or tokens stored in the repositories the tool enumerated, prioritizing routes in
github.routethat returned contents or secrets. - Review the actor's recent GitHub audit activity for successful secret access, clones, or archive downloads that indicate data was collected.
- If the identity or token is confirmed compromised, reset the user's credentials and review their OAuth app authorizations and PAT grants, removing any that are unauthorized.
- Block or rate-limit the offending
github.actor_ipat the network edge as a compensating control, recognizing that user agents and source IPs are easily changed. - Escalate to the repository and organization owners, and engage incident response per your organization's playbooks if sensitive data was exposed.