Safeguard
Security Guides•

In a supply chain incident, do you contain first or investigate first?

Contain first when harm is ongoing, but capture evidence in the same hour. A decision guide for the most common call in the first hour of an incident.

Safeguard Security Team
3 min read

Contain first when harm is ongoing or likely, and capture evidence in parallel. Investigate first only when containment would destroy evidence you cannot recover and no active damage is happening. In most supply chain incidents, a short freeze plus a quick evidence snapshot gives you both.

The real tension

Containment stops damage: revoke a token, freeze a pipeline, block a version. Investigation finds scope: what ran, what leaked. Some containment steps erase evidence, such as rebuilding a runner or clearing a cache. The art is choosing steps that stop harm and keep facts.

Decision guide

SituationChoiceWhy
Credential in active abuseContain nowEach minute adds harm
Bad version found in lockfile onlyInvestigate, then fixNothing is running
Bad version ran in CI, secrets exposedFreeze pipeline, snapshot, rotateStops new reads, keeps logs
Malicious artifact deployedContain, then investigateCustomers at risk
Unsure whether it ranFreeze and snapshot firstCheap, reversible

Containment steps that keep evidence

  1. Freeze, do not wipe. Pause pipelines and block the version at the proxy. Do not delete runners or caches yet.
  2. Snapshot. Export audit logs and copy CI logs, as covered in the evidence guide.
  3. Revoke, but record. Note the time and the old credential's last use before revoking.
  4. Isolate rather than reimage. Take an affected machine off the network, not off the evidence list.
  5. Then clean. After the snapshot, rebuild, purge caches and rotate.

NIST SP 800-61 Rev. 3, from April 2025, treats incident response as part of risk management with detection, response and recovery activities. The practical reading is that these overlap in time. You do not finish one before starting the next.

Who decides

The incident lead decides, and writes the decision and the reason in the log. If there is disagreement between security and engineering, the lead breaks the tie. See incident roles for a small team.

A worked example

Suppose a build runner installed a bad version at 02:10 and a teammate spots the advisory at 09:00. Nothing suggests active abuse, so freeze the pipeline, export the CI logs and audit logs, and block the version. Then rotate publish and cloud keys in order of power, and only after that wipe the runner. The freeze takes minutes and the snapshot takes under an hour. If at 09:20 you see a login to your cloud account from an address nobody knows, the call changes: revoke now, note the time, and keep collecting in parallel.

Quick check

Should we wait for the full investigation before revoking tokens?

No. Revoke exposed credentials now and record their state first.

Is freezing the pipeline too disruptive?

It is usually cheaper than a second bad build. Keep a short break glass path for urgent fixes.

Safeguard's policies and gates can block a risky dependency from entering a build while you investigate. A free scan is at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.