optional-skills/security/oss-forensics/references/investigation-templates.md
Pre-built hypothesis and investigation templates for common supply chain attack scenarios. Each template includes: attack pattern, key evidence to collect, and hypothesis starters.
Pattern: Attacker gains access to a legitimate maintainer account (phishing, credential stuffing) and uses it to push malicious code, create backdoored releases, or exfiltrate CI secrets.
Real-world examples: XZ Utils (2024), Codecov (2021), event-stream (2018)
Key Evidence to Collect:
Hypothesis Starters:
[HYPOTHESIS] Actor <HANDLE>'s account was compromised on or around <DATE>,
based on anomalous commit timing [EV-XXXX] and geographic access patterns [EV-YYYY].
[HYPOTHESIS] Release <VERSION> was published by the compromised account to push
malicious code to downstream users, evidenced by the malicious commit [EV-XXXX]
being added <N> hours before the release [EV-YYYY].
Pattern: A trusted package is modified to include malicious code in a dependency, or a new malicious dependency is injected into an existing package.
Key Evidence to Collect:
package.json/requirements.txt/go.mod before and after suspicious commitpostinstall, setup.py, etc.) that execute code on installHypothesis Starters:
[HYPOTHESIS] Commit <SHA> [EV-XXXX] introduced dependency <PACKAGE@VERSION>
which appears to be a malicious package published by actor <HANDLE> [EV-YYYY],
designed to execute <BEHAVIOR> during installation.
Pattern: Attacker modifies GitHub Actions workflows to steal secrets, exfiltrate code, or inject malicious artifacts into the build output.
Key Evidence to Collect:
.github/workflows/*.yml files before/after suspicious periodcurl, wget, or network calls added to workflow stepsenv: sections referencing secrets.*Hypothesis Starters:
[HYPOTHESIS] Workflow file <FILE> was modified in commit <SHA> [EV-XXXX] to
exfiltrate repository secrets via <METHOD>, as evidenced by the added network
call pattern [EV-YYYY].
Pattern: Attacker registers a package with a name similar to a popular package (or an internal package name) to intercept installs from users who mistype.
Key Evidence to Collect:
Hypothesis Starters:
[HYPOTHESIS] Package <MALICIOUS_NAME> was registered on <DATE> [EV-XXXX] to
typosquat on <LEGITIMATE_NAME>, targeting users who misspell the package name.
The package contains <BEHAVIOR> [EV-YYYY].
Pattern: After a malicious commit is detected (or before wider notice), the attacker force-pushes to remove the malicious commit from branch history.
Detection is key — this template focuses on proving the erasure happened.
Key Evidence to Collect:
distinct_size=0 (force push indicator) [EV-XXXX]payload.before)git fetch origin SHAHypothesis Starters:
[HYPOTHESIS] Actor <HANDLE> force-pushed branch <BRANCH> on <DATE> [EV-XXXX]
to erase commit <SHA> [EV-YYYY], which contained <MALICIOUS_CONTENT>.
The erased commit was recovered via <METHOD> [EV-ZZZZ].
Apply to every investigation regardless of template: