A supply chain incident starts the day a component you did not write, a CI action, a tool, a package, turns out to be compromised. The response comes down to four moves: establish the scope over time, contain, decide whether you are really affected, then notify within the deadlines of the CRA and NIS2. This lesson is for anyone running pipelines and shipping artifacts; it follows a real case, the compromise of Trivy in March 2026, and every command was replayed.
What you will learn
- Establish the scope: where the component is referenced, which runs executed it, which artifacts embed it
- Contain without losing evidence: cut workflows, re-pin, isolate workstations
- Decide and document "affected or not" with a VEX document
- Keep the regulatory clocks: 24 hours, 72 hours, final report
- Turn the incident into a lasting control, through the postmortem and the drill
- SOCLE anchoring: the incident response procedure, with roles and deadlines, of SOCLE-RUN-IRP-1 (in French)
How does a supply chain incident differ from a classic incident?
A classic incident starts from your system: a server, an application, an account. A supply chain incident starts from a third party, and you usually learn about it through an external alert, a security advisory or a researcher's post. The first question is therefore not "what happened on our side?" but "did we execute this component, and when?". Until that question has an answer, no other decision is grounded.
| Classic incident | Supply chain incident | |
|---|---|---|
| Starting point | your code, your infrastructure | a third-party component |
| Detection | your monitoring | an external alert, often late |
| Scope | what is affected | everything that executed or embedded the component |
| Fix | internal | depends on the upstream maintainer |
| Time dimension | the moment of the attack | an exposure window to reconstruct |
This lesson does not repeat the procedure for reacting to a compromised secret, which applies as is to each exposed secret. It covers what comes before: knowing which secrets were exposed.
The case used throughout: Trivy, March 2026
Trivy, Aqua Security's vulnerability scanner, was compromised in several
waves. At the end of February, an attacker exfiltrates a privileged token;
on 1 March, the incident is disclosed and the secrets are rotated. The rotation
was incomplete: on 19 March around 17:43 UTC, the attacker publishes a
booby-trapped v0.69.4 release and rewrites 76 of the 77 tags of
trivy-action. The malicious content is removed around 20:38 UTC, then on
22 March, booby-trapped Docker Hub images 0.69.5 and 0.69.6 appear in
turn.
The code injected into the action read the runner's memory to extract the job's secrets, exfiltrated them, then ran the real scan: the job stayed green. The advisory GHSA-69fq-xp46-6x23 and CVE-2026-33634 are its official record. The technical detail and the full timeline are in the analysis published on this site.
Two lessons for the response come out straight away. A green job proves nothing, since the real scan ran after the theft. And a partial rotation prolongs the incident instead of closing it: it is what enabled the second wave.
The three clocks of the response
The response is thought out over three horizons, because decisions do not have the same urgency. The first two hours are for knowing and cutting off; the first twenty-four for deciding and notifying; the first week for fixing the cause. Mixing horizons produces the classic mistake: spending the morning on the upstream fix while the stolen secrets remain valid.
| Horizon | Goal | Deliverable |
|---|---|---|
| H+2 | scope and containment | list of exposed runs, artifacts and workstations; workflows cut |
| H+24 | decision and notification | VEX, secrets rotated, early warning sent if you are bound to |
| D+7 | fixing the cause | postmortem, controls added, drill scheduled |
These deadlines are those of a procedure written in advance, with its roles: who leads, who investigates, who rotates the secrets, who notifies. A procedure improvised on the day loses the first hour deciding who does what.
Step 1: establish the scope (H+2)
The scope has three dimensions, and you need all three: the references to the component in your repositories, the executions that actually ran it during the window, and the artifacts that embed it. A reference with no known execution in the window does not prove exposure, but neither does it rule exposure out when logs are missing. A historical run may have been exposed even if the current workflow no longer refers to the component: recover the executed revision, the tag resolution at run time and the job's permissions, rather than assuming every resource was compromised.
Where is the component referenced?
In a repository, a text search in the workflows is enough. The second command isolates references not pinned by SHA, those most directly affected by a tag rewrite. Pinning to an authentic commit prevents tag movement, but does not protect against a malicious commit already pinned, dependencies downloaded at runtime or another compromise route:
grep -rnE 'aquasecurity/(trivy-action|setup-trivy)@' .github/workflows/grep -rnE 'uses: [^ ]+@[^ ]+' .github/workflows/ | grep -vE '@[0-9a-f]{40}( |$)'.github/workflows/scan.yml:11: - uses: aquasecurity/trivy-action@0.33.1.github/workflows/scan.yml:12: - uses: aquasecurity/setup-trivy@v0.2.2.github/workflows/release.yml:8: - uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # 0.35.0release.yml references a commit SHA: the tag rewrite did not reach it.
scan.yml calls two tags, so whatever content they designated at the time
of each run. Across an organisation, gh search code does the same work over
every repository, with one limit to know: code search only covers the
default branch.
gh search code 'aquasecurity/trivy-action' --owner my-org --json repository,pathWhich runs actually executed it?
This is the question that decides everything, and the exposure window answers it. List the runs of the workflow concerned between the compromise and the removal, widening the window by a margin: published times are estimates.
gh run list --repo my-org/billing-api --workflow scan.yml \ --created '2026-03-19..2026-03-23' \ --json databaseId,headSha,createdAt,conclusionFor each run, the log says which commit was actually downloaded for each action, at execution time. It is the evidence that settles it, since a tag may have changed since:
gh run view <run-id> --repo my-org/billing-api --log | grep 'Download action repository'On a real run, the line looks like this, here for another action:
Download action repository 'actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3' (SHA:3a2844b7e9c422d3c10d287c895573f7108da1b3)Compare the SHA shown with the list of malicious commits published in the indicators of compromise. A run that downloaded one of them exposed every secret its job could reach. Logs expire, after 90 days by default on GitHub: archive them as soon as the alert comes in, they are your evidence.
Which artifacts embed the component?
When the compromised component is a package shipped in your deliverables,
the scope reads from the SBOMs. An SBOM archived at every build answers in
seconds, without rebuilding or downloading anything again. The example replays
the historical event-stream incident, whose flatmap-stream 0.1.1
dependency carried code stealing cryptocurrency wallets:
syft scan dir:billing-api -o cyclonedx-json=billing-api.cdx.json -qjq -r '.components[] | select(.name=="flatmap-stream") | "\(.name) \(.version) \(.purl)"' billing-api.cdx.jsongrype sbom:billing-api.cdx.json -qflatmap-stream 0.1.1 pkg:npm/flatmap-stream@0.1.1NAME INSTALLED FIXED IN TYPE VULNERABILITY SEVERITY EPSS RISKevent-stream 3.3.6 4.0.0 npm GHSA-mh6f-8j2x-4483 Critical N/A N/Aflatmap-stream 0.1.1 npm GHSA-9x64-5r7x-2q53 Critical N/A N/Aflatmap-stream 0.1.1 npm GHSA-mh6f-8j2x-4483 Critical N/A N/Ajq answers immediately, even before the scanner's database knows the advisory; grype confirms it as soon as the advisory is published. Repeated over the SBOM archive, the same query lists every shipped version concerned. The SBOM lesson details this practice.
Step 2: contain without destroying evidence (H+2)
Containing means preventing the component from running again, and preventing what it stole from being used. The moves follow in this order, because each one narrows the window of the next.
-
Cut the exposed workflows.
gh workflow disable scan.yml --repo my-org/billing-apiprevents any new run without deleting anything: the logs and the history remain available. -
Re-pin on a clean version, by SHA. For
trivy-action, the only tag left clean was0.35.0, which points to commit57a97c7e7821a5776cebc9bb87c984fa69cba8f1. A tag is not a trusted reference during the incident, since it is precisely what was rewritten. -
Rotate every exposed secret. All those a compromised run could read, not only those you believe are used. The procedure is the one in the lesson Reacting to a compromised secret: revoke first, investigate afterwards.
-
Check the development workstations. Outside CI, the
v0.69.4binary installed a user systemd service designed to stay in place. On every workstation that ran it, look for its traces:Terminal window ls -la ~/.config/systemd/user/sysmon.pysystemctl --user list-unit-files | grep -i sysmonOn a clean workstation, the first command fails with
No such file or directoryand the second returns nothing. A trace found makes it a compromised workstation: all its secrets are compromised too.
The early-March rotation is the mistake not to repeat. An exhaustive rotation starts from the inventory of what each exposed run could read, and is verified by trying to use the old secret: it must be refused.
Step 3: decide and document (H+24)
As the scope becomes clearer, assign each system and artifact an investigation status: confirmed exposure, possible exposure, or demonstrated absence of execution, with supporting records. Do not force a binary conclusion where logs are incomplete.
A VEX document is appropriate for an identified vulnerability affecting a particular product. It is not an inventory of CI jobs that executed a compromised action, nor proof that secrets were not stolen. The VEX lesson explains the required statuses and justifications. The example below concerns a dependency vulnerability in a product; it does not replace the exposure register for runners and tokens:
vexctl create --product 'pkg:npm/billing-api@1.4.0' --vuln GHSA-mh6f-8j2x-4483 \ --status affected \ --action-statement 'event-stream removed, rebuild and npm token rotation in progress'{ "statements": [ { "vulnerability": { "name": "GHSA-mh6f-8j2x-4483" }, "products": [ { "@id": "pkg:npm/billing-api@1.4.0" } ], "status": "affected", "action_statement": "event-stream removed, rebuild and npm token rotation in progress" } ]}In parallel, keep a timestamped timeline: every finding, every move, its author and its evidence. It serves three times, to steer the crisis, to fill in the notifications, and for the postmortem. Written afterwards, it is rebuilt from memory; written during, it is authoritative. Here is what its first lines look like for the example repository:
| Timestamp (UTC) | Finding or move | Who | Evidence |
|---|---|---|---|
| 20/03 08:10 | GHSA advisory received | on-call | advisory link |
| 20/03 08:40 | 3 exposed runs identified | security | archived logs |
| 20/03 09:05 | scan.yml disabled, action re-pinned | platform | commit, audit log |
| 20/03 11:30 | 14 secrets rotated, old ones refused | platform | refusal test |
Step 4: notification obligations
Two European texts set deadlines, and they do not target the same actors. The CRA, Regulation (EU) 2024/2847, applies to the manufacturer of a product with digital elements placed on the European market. Its Article 14, which organises reporting, has applied since 11 September 2026. NIS2, Directive (EU) 2022/2555, applies to essential and important entities in the sectors it covers, through its transposition in each Member State.
| Text | Trigger | Early warning | Notification | Final report |
|---|---|---|---|---|
| CRA, Art. 14(2) | actively exploited vulnerability in your product | 24 h | 72 h | 14 days after a fix is available |
| CRA, Art. 14(4) | severe incident affecting the product's security | 24 h | 72 h | one month after the notification |
| NIS2, Art. 23 | significant incident for the entity | 24 h | 72 h | one month after the notification |
The deadlines run from the moment you become aware, not from the start of the attack. Under the CRA, the report goes simultaneously to the CSIRT designated as coordinator and to ENISA, via the single reporting platform of Article 16; under NIS2, it goes to the CSIRT or competent authority of the Member State. For a vendor whose product embedded a booby-trapped component, a severe incident within the meaning of the CRA is likely: the text explicitly covers the introduction of malicious code at a user's.
This table does not replace legal advice, but it says what the procedure must provide for: the decision-maker for the notification, its writer, and the information the timeline must already hold at H+24. The CRA and NIS2 pages (in French) detail the scope of each.
Step 5: learn from the incident (D+7)
The postmortem answers a single useful question: which control would have changed the outcome? On the Trivy case, the answers are known and verifiable: SHA pinning would have neutralised the tag rewrite, narrowly scoped secrets would have limited what the job could give away, ephemeral runners would have bounded persistence. The blameless format is described in the lesson Incidents and postmortems.
A procedure that has never been used is not a procedure. Schedule a drill at least twice a year, on a realistic scenario: an action you use is declared compromised, it is up to you to produce the list of exposed runs and secrets to rotate. Measure the time to that list; it is the indicator that improves most from one drill to the next.
Common pitfalls
These mistakes share one trait: they give a false sense of control. They are all spotted with the same question: do you have evidence of what you claim, or only a reasonable assumption?
| Pitfall | Why it is wrong | Instead |
|---|---|---|
| "The job was green, so nothing leaked" | the booby-trapped code ran the real scan after the theft | rely on the downloaded SHA, read in the log |
| Searching only the current code | a workflow changed since may have run the component | list the runs of the window |
| Rotating "the main secrets" | the attacker keeps whatever was not rotated | rotate everything the job could read, check the refusal |
| Re-pinning on a "clean" tag | the tag is precisely what was rewritten | re-pin on a verified commit SHA |
| Waiting for the upstream fix to act | stolen secrets stay valid meanwhile | contain first, fix afterwards |
Key points
- The first question is "did we execute this component, and when?": scope in references, executions and artifacts
- The run log gives the SHA actually downloaded: that is the evidence of exposure, not the tag or the job's colour
- Archived SBOMs answer in seconds for an embedded package
- Contain: cut workflows, re-pin by SHA, rotate every exposed secret, check workstations
- A partial rotation prolongs the incident: it is what enabled the second Trivy wave
- The decision is recorded in VEX, the moves in a timestamped timeline kept during the crisis
- CRA (manufacturers, since 11 September 2026) and NIS2 (essential and important entities): early warning within 24 h, notification within 72 h
- Expected evidence: a documented incident response procedure, with roles and deadlines
Test your knowledge
The questions cover the decisions of the response rather than syntax: what proves an exposure, the order of containment moves, and the regulatory deadlines to meet.
Knowledge check
Check what you have learned with this interactive quiz
How it works
- The timer starts when you click Start
- Multiple choice, true/false and short answer questions
- You can move between questions
- Detailed results are shown at the end
Starts the quiz and the timer
Review
(0/0)Result saved on this device. It will be sent to your account at the next sync. Sync now
Score by domain
A domain groups several guides and gets several questions, so its score is more reliable than a per-topic score, which often rests on a single question.
Summary
Strengths
No topic passed at 80% on at least two questions yet.
Weak areas
No topic below the pass mark.
Recommended next
Hints before you try again?
Continue the course: Verifiable build: SLSA provenance, SBOM and signature
A new full quiz with random questions
Work again only on the questions you missed