Run Trivy before your client does, even though it was hijacked
One scan finds known vulnerabilities and leaked secrets before a client's security team does, and March's tag hijack changes how to run it in their CI.
In brief
- For container images, Trivy scans for vulnerabilities and secrets by default; change the combination with --scanners.
- A clean report reflects only the advisory sources Trivy uses; it does not prove an image is safe.
- After the March 2026 incident, pin trivy-action to a commit SHA rather than a version tag.
In March 2026, malware turned up inside a security scanner. Aqua Security said 76 of the 77 version tags of trivy-action had been force-pushed to malicious commits, and that a malicious Trivy v0.69.4 binary had been released.
Trivy still belongs in an FDE’s toolkit, but the incident changes how you should use it. The tool’s value is simple: it shows you in advance what the client’s security team is likely to find.
Say a bank’s security team scans the image you have just delivered and finds an API key inside. You lose more than a few days fixing it; you lose credibility at the very moment the client is deciding whether the system goes to production. Scanning it yourself before handover is far cheaper.
One command, two questions
Trivy is an open-source project maintained by Aqua Security and released under the Apache-2.0 licence. Its scope is broad: vulnerabilities, misconfigurations, secrets and SBOMs, across targets such as container images, filesystems, remote git repositories, VM images and Kubernetes.
For container images, two scanners are on by default: vulnerability and secret. They answer two questions. Do the software components in the image have known vulnerabilities? Is any sensitive information exposed?
The vulnerability scan covers both operating-system packages and language packages. The same report can therefore tell you about the base image and the application’s dependencies, two things usually owned by two different people.
When does an FDE need Trivy?
The clearest moment is just before handover, when the image is built but has not yet left your hands. The second is when the client sends over a list of findings and you need to check it against the image that is actually running.
The third comes earlier still: when you have just received a client’s repo. Secret scanning also works on filesystems and git repositories, so you can find out what a repo contains before packaging it into anything.
One scan before handover day
Take a hypothetical example: you are about to deliver the image acme/api:1.4.2 to a client. The first run needs no flags, because the two scanners you want are already on.
trivy image acme/api:1.4.2
Suppose the results show 180 vulnerabilities and 1 secret. Do not start with the 180. The secret is the thing you can deal with right away, and the worst thing to have discovered later. If the image has ever been pushed to a registry, treat the secret as leaked: revoke and reissue it first, then rebuild the image.
After the rebuild, scan again and drop the vulnerabilities that have no fix yet, since those are lines you cannot resolve by upgrading.
trivy image --ignore-unfixed acme/api:1.4.3
Suppose 120 lines disappear and 60 remain. Now you have a list you can act on: upgrade the base image, upgrade dependencies, scan again. When you need to check one category on its own, --scanners runs only that scanner:
trivy image --scanners secret acme/api:1.4.3
Filters help you focus, and make it easy to fool yourself
Go back to those 120 lines. --ignore-unfixed removes them from the screen, not from the image. If you send only the filtered report and the client’s security team runs the full one, they will see 120 lines you never mentioned.
The safer approach is to send both versions, with a sentence explaining what you filtered and why. Do not make zero the goal of your handover email; show the client’s security team that you understand your own risk.
Ignore files need the same discipline. Trivy supports .trivyignore and .trivyignore.yaml for vulnerabilities, misconfigurations and secrets, so a hastily added line can hide a real secret. A sensible rule: every ignored entry goes through code review, with a reason and a named owner.
The bigger limit lies in the data itself. Trivy’s documentation states that the tool uses only advisories from the sources it lists, so a vulnerability not yet in those sources will not appear in the report.
So do not write “the image is safe” in a handover email. Be more precise: which Trivy version you scanned with, on what date, and what it found.
In a client’s CI, a tag is not a promise
Aqua’s official GitHub Action for running Trivy on Docker images is aquasecurity/trivy-action. This is the component that had 76 of its 77 tags force-pushed, so a workflow pointing at a tag could run malicious code without anyone changing a line in the repo.
Aqua recommends pinning the action to a full commit SHA rather than a version tag, because a SHA is immutable and a tag is not. To find out which commit a tag points to, ask the repo directly, replacing TAG with the tag you intend to use:
git ls-remote https://github.com/aquasecurity/trivy-action "refs/tags/TAG" "refs/tags/TAG^{}"
The output starts with a 40-character SHA. If there are two lines, the one ending in ^{} is the commit to pin.
Do not stop there. The command only tells you where the tag points right now; it does not prove the commit is clean. Open the commit on GitHub, read the changes, check them against Aqua’s advisory, and only then put the SHA in the workflow.
A minimal workflow might look like this, using the example image above:
name: scan-image
on: pull_request
permissions:
contents: read
jobs:
trivy:
runs-on: ubuntu-latest
steps:
- uses: aquasecurity/trivy-action@FULL_COMMIT_SHA # TAG
with:
image-ref: acme/api:1.4.3
This file only illustrates SHA pinning and is not yet a real gate in CI: the image name is hard-coded, and nothing defines when the job passes or fails.
The tag name sits in a comment so reviewers know which version you meant; what actually runs is the SHA. Note that the job declares no secrets. If the image lives in a private registry, the job will need credentials, and that is something to weigh before you add them.
Do not treat SHA pinning lightly, because the cost of a swapped action is high. Aqua asks that every secret an affected runner could access be treated as exposed and rotated.
In a client’s CI, that runner may hold the client’s credentials, not yours. Before adding any action, ask: which secrets can this job reach? Then check whether any machine or runner is still on v0.69.4.
If you find that version on a runner, treat every secret the runner could access as exposed and rotate it, even if there is no sign of misuse.
What to learn first, and how to talk about it
A sensible order: run trivy image on an image of your own, understand each part of the report, then practice with --ignore-unfixed, .trivyignore and --scanners. Once you are comfortable, wire it into a workflow with a SHA-pinned action. Other targets such as Kubernetes and VM images can wait.
For your career, knowing a command is the least valuable part. On your CV, describe outcomes: scanning images before handover, handling secrets, cutting the findings list down to something the client’s security team could review, pinning CI to SHAs.
When reading job descriptions, look for terms such as container security, SBOM or customer security review. If they appear, have an example ready of an image scan you did yourself, and in the interview explain how you decided which lines to ignore and what you told the client about them.
The next time a security team asks “has this image been scanned?”, a credible answer does not rest on a zero. It rests on being able to say what you scanned with, what you filtered, and why that scanner deserves to run in their systems.
Was this article useful?
Thanks for the feedback!