Why Did My Trivy Scan Report 400 CVEs I Can’t Fix

A Trivy scan that reports 400 CVEs is not a security finding. It is a training exercise that teaches your team the scanner is noise and can be safely ignored.

I have watched this happen more than once. A team wires Trivy into the pipeline, runs it against their application image, and gets back a wall of several hundred vulnerabilities in red. Nobody can triage that. So the build either stays green because the gate was set to warn-only, or it goes red and someone adds a blanket exception to make it green again. Either way, the scanner has stopped doing its job on day one. The fix is not a better scanner. It is understanding where the number comes from and attacking it at the root.

Where the 400 actually comes from

The overwhelming majority of those CVEs are not in your code and not in your application dependencies. They are in the operating-system packages that ship inside your base image. A stock python:3.12 or node:20 image is a full Debian userland: hundreds of OS packages, most of which your application never calls. Every one of those packages has a version, and every version has a CVE history.

Free · 4 minutes

Would you survive contact with a determined attacker — or an auditor?

Fourteen questions on access, patching, detection, and recovery — the basics that prevent most real incidents, and the ones most often assumed rather than verified. Banded finding on screen, full sheet by email.

Crucially, a large share of those OS-layer CVEs have no fix available. The Debian security team has assessed them and marked them will-not-fix, affected but deferred, or the package is simply past end-of-life for patching. Trivy dutifully reports them because they are real, but there is nothing you can do about them by patching. You cannot upgrade to a fixed version that does not exist. So the first thing to separate is signal you can act on today from noise you provably cannot.

Filter to what you can act on today

Two flags do most of the work. Restrict severity to the levels you would actually block a release for, and drop everything with no fix available. --ignore-unfixed is a shorthand for --ignore-status affected,will_not_fix,fix_deferred,end_of_life — it shows you only vulnerabilities where a fixed version genuinely exists.

# The wall of 400 — everything, every severity, fixed or not
trivy image myapp:latest

# What you can actually do something about today:
# HIGH/CRITICAL only, and only where an upgrade path exists
trivy image \
  --severity HIGH,CRITICAL \
  --ignore-unfixed \
  myapp:latest

The 400 typically collapses to a handful. That handful is your actual work queue: fixable, high-impact, in packages you control. Use this filtered view as the pipeline gate — fail the build on fixable HIGH/CRITICAL and nothing else. You now have a scanner people trust, because every red result comes with an action.

One caveat worth naming: --ignore-unfixed hides real, exploitable weaknesses that happen to be unpatched. That is an accepted risk, not a resolved one. The point is to stop the unfixable set from drowning the fixable set — not to pretend it is gone.

Attack the root cause: the base image

Filtering makes the scan readable. Swapping the base image makes the underlying count genuinely smaller, unfixable ones included. Most of the OS-layer noise exists because you are shipping a general-purpose Linux distribution to run one process. You do not need a shell, a package manager, or half of coreutils in production. Every one of those you remove is a package that can no longer carry a CVE.

The cheapest win is moving from the full image to its -slim variant, which strips the base down to a much smaller Debian footprint while keeping the same language runtime.

# Before: full Debian base, hundreds of OS packages you never invoke
FROM python:3.12

# After: same Python, minimal Debian, far fewer packages to scan
FROM python:3.12-slim

The further step is distroless — an image with the language runtime and its shared libraries and nothing else: no shell, no apt, no busybox. Build in a stage that has the toolchain, then copy only the artefacts into the distroless runtime.

# Build stage: full toolchain to compile and install dependencies
FROM python:3.11-slim AS build
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt

# Runtime stage: distroless — no shell, no package manager
# Match the runtime's Python minor version to the build stage
FROM gcr.io/distroless/python3-debian12
COPY --from=build /install /usr/local
WORKDIR /app
COPY . .
ENV PYTHONPATH=/usr/local/lib/python3.11/site-packages
CMD ["-m", "myapp"]

The reduction is dramatic because you have deleted the layers where the CVEs lived. I have written separately about why I switched to distroless base images, including the operational trade-offs — no shell means no kubectl exec to poke around, which is a feature for security and an adjustment for debugging.

Document the ones you accept, with an expiry

You will still be left with a small set of fixable findings you have decided not to act on yet — not reachable from your code path, or awaiting an upstream release. Do not silence those with a blanket exception. Record each one in a .trivyignore file, with a reason and, critically, an expiry date so the acceptance is forced back for review rather than becoming permanent.

# .trivyignore
# libssl issue, not reachable from our request path — reviewed 2026-07-01
# Re-assess when the fixed Debian package lands. Expires below.
CVE-2024-9999 exp:2026-09-01

The inline exp:YYYY-MM-DD field means Trivy stops honouring the ignore after that date, and the finding reappears in your gate. That turns a silent, forgotten exception into a dated decision with an owner. If you prefer structured records, the experimental .trivyignore.yaml format carries the same idea through expired_at and a free-text statement field per entry.

Prove the swap worked

Re-scan the new image with the same filtered command and compare the count. The number should fall sharply — not because you hid anything, but because the packages carrying those CVEs are no longer in the image. That before-and-after is also the evidence a security reviewer or auditor will actually accept: not “we run a scanner”, but “here is the count before, here is the count after, here is the queue of what remains and who owns it”.

If you are still weighing the tool itself, I have compared Trivy and Grype for vulnerability scanning elsewhere; the triage discipline here applies to either. And if you want to know precisely what is inside a given image before you scan it, Trivy will also emit an SBOM-style bill of materials — the same inventory logic, one layer down.

A scanner is only useful if its output is short enough to be believed. Cut the base image down to what you actually run, filter to what you can actually fix, and date every exception you keep. Four hundred findings nobody reads protect nobody. Six findings with owners protect the build.

Build and rescue work

Hands-on delivery of this kind is handled by Sixteen Pillars Studio.

Free interactive tool

Website compliance checklist

What your site has to do, based on what it actually does

Answer as much or as little as you like — the list builds as you go. Nothing is stored against your name and no email is required.

Most technology problems are not technology problems. They are control problems.

The systems exist. The investment has been made. The question is whether leadership can understand, direct, evidence, and sustain what those systems produce. Find out where control exists — and where it only appears to.