Reference for investigating security incidents across multiple attack vectors, including the key surfaces and tools to check on GitHub.
This reference article shows you which GitHub tools to use and which GitHub surfaces to check when you're responding to a security incident. Use this article to guide your investigation across major threat categories.
For full guidance on how to respond to a security incident, including containment strategies, see Responding to a security incident.
Important
The availability of each tool (and the data it provides) varies by GitHub plan, role, permissions, feature enablement, and pre-incident configuration (for example, audit log streaming and IP address disclosure require prior set up). For more information, see Investigation tools for security incidents.
Be aware that real-world security incidents rarely involve a single attack vector. A credential compromise may lead to malicious code injection, which may enable data exfiltration. As you investigate a threat signal, be prepared to move into other investigation areas, and to loop through containment, deeper investigation and remediation as you uncover new indicators of compromise and as your understanding of the threat model evolves.
This section may apply when:
You suspect a token or key has been stolen or exploited, received a secret scanning alert, or found credentials exposed in code, logs or a public repository.
.env files, or configuration files across repositories.| Tool | Purpose |
|---|---|
| Audit log | Trace token usage |
| Security overview | View organization- or enterprise-level security alerts and activity, particularly secret scanning alerts |
| GitHub code search | Search for exposed credentials in code |
This section may apply when:
You noticed unusual login activity, saw unexpected commits or changes, or detected suspicious account behavior.
org.add_member, repo.add_member, org.add_outside_collaborator, org.update_member, repo.update_member, role.create, role.update.public_key.create, integration_installation.create.repo.create, repo.access.| Tool | Purpose |
|---|---|
| Audit logs | Search and cross-check actions, actors and IP addresses |
| Activity view | Review activity for specific repositories |
This section may apply when:
You detected large downloads, unusual API activity, or received reports of your data appearing externally.
git.clone, git.fetch) or API requests, particularly from an unfamiliar actor (actor) or IP address (if IP address visibility is enabled), that indicate bulk data collection.
repo.create, repo.access (visibility changes), repo.rename, repo.transfer).hook.create or similar events in the audit logs), and check if any webhook points to an unrecognized domain.| Tool | Purpose |
|---|---|
| Audit logs | Search for relevant actions |
This section may apply when:
You found suspicious code in your repository, a security researcher reported an issue, or you noticed unexpected workflow behavior.
GITHUB_TOKEN, any personal access tokens, GitHub App tokens, or other credentials stored as secrets. The GITHUB_TOKEN is scoped to the job and expires when the job completes, but other credentials have their own lifecycle and do not expire with the job. Any credential that may have been exposed should be treated as compromised and rotated or replaced immediately..github/workflows/), shell scripts, or configuration files.repository_ruleset.destroy, repository_secret_scanning_push_protection.disable, or other .delete, .disable, .destroy events).org.register_self_hosted_runner, repo.register_self_hosted_runner events).| Tool | Purpose |
|---|---|
| Workflow runs and logs | Review workflow execution and inspect log output |
| Activity view | Identify unexpected pushes, force pushes, or pushes from unfamiliar actors |
| GitHub code search | Search for suspicious code patterns |
| Audit logs | Filter by action to find security setting changes |
Note
[!NOTE]
Runner IP addresses are dynamically assigned from shared infrastructure and may be flagged due to unrelated activity. For more information, see Troubleshooting workflows.
This section may apply when:
You received a malware or dependency alert, suspect a malicious package, or noticed unexpected dependencies in your projects.
npm ecosystem only.type:malware in the advisory database.package.json, package-lock.json, Gemfile.lock). Check blame views and pull requests to identify who introduced the changes and whether they were reviewed.| Tool | Purpose |
|---|---|
| GitHub code search | Search for references to the suspected package or Action |
| Dependency graph | Visualize and review dependencies |
| Dependabot alerts | Review for alerts relating to vulnerable dependencies |
| GitHub Advisory Database | Search for type:malware |
| Activity view | Review recent pushes to repositories |
| Security overview | Review recent security alerts across an organization or enterprise |