Safeguard
Supply Chain•

How do you replace a compromised CI action across every repo in a day?

A runbook for when a third party CI action is compromised: find usage, cut exposure, rotate secrets and ship the fix by pull request.

Safeguard Security Team
3 min read

Find every use of the action, stop it running, rotate any secret it could reach, then replace it with a pinned safe version through bulk pull requests. If workflows call a shared template, you can cut exposure in one change. Speed depends on the inventory you built beforehand.

Hour 0 to 1: contain

  1. Confirm the advisory from the maintainer or a reputable source.
  2. Search all repos for the action name. A code search on uses: and the action name works, and so does your own workflow inventory.
  3. If an org setting restricts allowed actions, remove the action from the allow list. GitHub documents an allow and block list with wildcards, up to 1,000 entries, so this stops new runs quickly.

Blocking is blunt but fast. Expect some pipelines to fail, and tell teams why.

Hour 1 to 4: assess exposure

Check which workflows ran the affected version in the exposure window. Look at what each had access to: repository secrets, environment secrets, cloud credentials, the token and its permissions. A job with a read only token and no secrets has little to lose. A deploy job with cloud keys does not.

If you moved to OIDC, there are fewer stored keys to rotate, and tokens are short lived. The GitHub hardening guide recommends OIDC so you can stop storing long lived credentials.

Hour 4 to 8: rotate

Rotate any secret that was available to a run using the action. Start with deploy credentials and package publishing tokens. Review audit logs for unusual use. Record each rotation, because auditors and customers may ask.

Hour 8 to 16: replace

Write a script that edits workflows to remove the action or pin it to a verified safe SHA, and opens a pull request in each repo. If you use a shared workflow, fix it there and release a patch tag. A bot can bump callers.

Hour 16 to 24: verify and review

Confirm there are no remaining references. Re-enable the allow list entry only for the safe version if needed. Write a short review: how you found out, how long exposure lasted, what slowed you down.

Prepare before it happens

PreparationBenefit
Workflow and action inventoryInstant search
SHA pinning requiredMoving tags cannot silently change code
Read only default tokenSmaller blast radius
OIDC instead of stored keysLess to rotate
Shared templatesOne place to fix

See also org level Actions defaults.

Quick check

Is pinning to a SHA enough to be safe?

It stops a tag being moved under you, but you still need to verify the SHA is the right code from the right repository, not a fork.

Should we block the action first or investigate first?

Block first if the advisory is credible, then investigate. You can unblock later.

Safeguard provides asset discovery, SBOM and dependency scanning that help you answer where a component is used, and supports a free scan 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.