Cloud Native Security 03: Secure the Supply Chain¶
Teams run Trivy to find security problems in their images. In March 2026, attackers published a version that stole secrets from the pipelines running it1. It could reach those secrets because the pipelines gave it access.
This post covers everything between a merged commit and an image in your registry. The goal is to be able to prove that what you run is what you built.
Prefer to watch? This 5-minute video covers the whole post. It's in Thai, and the voice and presenter are AI versions of me.
The Cloud Native Security series
- The whole picture
- Secure the code
- Secure the supply chain (this post)
- Check before it runs
- Protect what's running
- Identity, secrets and data
- Respond, comply and a 90-day plan
- Tools and whitepaper map
Treat the pipeline as production¶
Your build system can read the source, use the passwords and publish releases. Anyone who controls it controls everything you ship.
| Problem | What to do |
|---|---|
| Stored cloud keys get stolen | Let the pipeline log in with OIDC, which gives it a key that expires soon after the job |
| A third-party action changes under you | Lock every action to an exact commit |
| A scanner steals secrets | Run scanners in a job that has no secrets |
| One project's build reads another's | Separate build machines by how sensitive the project is |
| Nobody checks the pipeline files | Scan them with zizmor and require platform team approval |
On GitHub, lockfiles for Actions became generally available in October 2026. They pin the actions you use and the ones those actions use2. If you call reusable workflows, pin those to a full commit yourself.
A moved tag is how tj-actions, another popular action, was turned against its users in 2025. The name stayed the same and the code behind it changed.
Start from a small image¶
Every program in an image is something to patch and something an attacker can use. A web service rarely needs a shell or a package manager.
| Option | Good for |
|---|---|
| Docker Hardened Images | Most teams. Free for production since December 2025, and you need a Docker account |
| Distroless | Compiled programs that need almost nothing else |
Build the image to run as an ordinary user, and copy in only the finished program.
Scan, then fix the dangerous things first¶
A scan of a normal image can return hundreds of findings. Nobody fixes them all, so the order matters more than the count:
- Is it already being used in attacks? Check CISA's list of known exploited vulnerabilities, called KEV.
- Can your code reach the vulnerable part?
- How likely is an attack soon? EPSS gives a probability.
- How bad would it be? That's the CVSS score.
This order is my recommendation, and no standard requires it. CVSS comes last because it measures how bad a flaw could be, and most bad flaws never get used.
Scan in the pipeline, and again every day in the registry. An image that was clean last month can have a known hole today. Don't rely on one source of scores either: since April 2026, the US vulnerability database adds its own analysis only to priority flaws3, so your scanner may show some with no score.
Post 7 has deadlines you can copy for each kind of finding.
Keep a parts list for every release¶
An SBOM (software bill of materials) is the list of everything inside an image. When the next big flaw is announced, the question is always "do we use it, and where?" With SBOMs stored for each release, you search. Without them, you ask every team.
Syft makes one from an image. Choose CycloneDX or SPDX as the format, then store the file next to the image. CISA published a new list of what an SBOM should contain in July 20264.
Sign what you build, and record how¶
A signature proves the image came from you and hasn't changed. Provenance is a signed record of how it was made, with the commit and the pipeline that built it. Together they stop someone from swapping an image in the registry without you noticing.
| Where you build | Use |
|---|---|
| Public repositories on GitHub | GitHub artifact attestations |
| Private repositories or other CI systems | Cosign |
Attestations on private GitHub repositories need an Enterprise Cloud plan. Anyone can check one like this:
Always sign the image's digest, the long fingerprint of its exact contents. Tags can be moved.
How far to take it¶
SLSA is a set of levels for how trustworthy a build is5:
| Build level | In plain words | Who needs it |
|---|---|---|
| 1 | You have a record of how it was built | Everyone |
| 2 | A hosted build service signed that record | Anyone who ships software to others |
| 3 | The build is isolated, so it can't fake the record | High-value targets |
GitHub's attestations reach level 2 without extra work.
Give images a path through registries¶
Letting every developer pull any public image into production skips all the checks above. Use stages:
| Stage | Who can write to it |
|---|---|
| Approved public images | A small group, or an automatic copy after scanning |
| Team images | The team's pipeline |
| Production images | The release pipeline only, after every check |
Harbor does this with projects and permissions, and scans what's inside. Zot is a smaller alternative. Use TLS for every connection, and block anonymous writes.
You can also encrypt images. It's worth the trouble only when the contents are secret, such as a trained model you sell.
Know what to do when a supplier is compromised¶
It'll happen to something you use. The Trivy attack started because an earlier theft was only partly cleaned up, and the attackers kept access6.
- Find every place that ran the bad version, using your SBOMs and pipeline logs
- Replace all the credentials those jobs could see, on the same day
- Rebuild from clean versions and redeploy
- If your signing key was exposed, revoke it and sign again
The eShop series shows scanning, signing and verification working end to end, with the real logs.
Summary¶
| If you're worried about... | Do this |
|---|---|
| Stolen pipeline keys | OIDC, and scanners with no secrets |
| A changed third-party action | Lock actions to commits |
| Too many findings | Sort by KEV, reachable, EPSS, then CVSS |
| "Are we affected?" | Store an SBOM for every release |
| A swapped image | Sign the digest, and check it at deploy time |
- List the secrets each pipeline job can read, and remove the ones it doesn't need
- Lock your actions and add zizmor to pull requests
- Move one service to a hardened base image
- Sign one image, then make the cluster check it in post 4
Next: Check before it runs
-
Aqua Security, advisory GHSA-69fq-xp46-6x23: the bad versions were Trivy 0.69.4 and the 0.69.5 and 0.69.6 images, plus hijacked
trivy-actionandsetup-trivytags. ↩ -
NIST, Changes to NVD operations, April 2026. ↩
-
CISA and partners, 2026 minimum elements for an SBOM. ↩
-
SLSA, Build track, v1.2. ↩
-
Aqua Security, What happened in the Trivy attack. ↩
Discussion
Have thoughts on this post? Share them below — questions, corrections, or your own experience are all welcome.
