Counting the CVEs in My Homelab with Trivy
Published Dec. 2, 2026, 8 p.m. by wielandtech
I've spent a lot of time making the cluster reliable. Backups, GitOps, metrics, a tunnel so my home IP stays out of DNS. What I'd never actually checked was what's inside the roughly 130 container images it runs. Some I build myself and some come straight off Docker Hub, and I had no idea how many known vulnerabilities were sitting in either kind.
So I installed the Trivy Operator. It watches every workload in the cluster, and whenever a new image shows up it starts a scan job that pulls the image, checks every OS package and library against the vulnerability databases, and writes the result back as a VulnerabilityReport resource next to the workload. A ServiceMonitor sends the counts to Prometheus, so they land in Grafana with everything else, and a couple of alert rules fire when the critical and high counts get out of hand.
kubectl get vulnerabilityreports -A
The first full pass came back with 204 reports, 123 criticals, and over 2,200 highs. Not great.
Getting the scanner itself to behave took longer than reading what it found. In about a week:
- The operator kept getting OOM-killed, so it got more memory. Twice.
- Scan jobs fought over a shared vulnerability database cache and locked each other out. Switching Trivy to client-server mode, with one server holding the database and the scan jobs asking it, fixed that.
- The scan jobs had a 256MB memory limit, which is nothing when you're unpacking a CUDA image. One afternoon I counted 26 OOM-killed scans in 40 minutes. They get 1GB now.
- The node collector, which audits each node's own config, sat in Pending forever on my GPU node because of the node's GPU taint. I added a toleration, and then it still didn't schedule, because the operator only reads that setting at startup and nothing restarted it. Reloader handles that now.
- Once the scans stopped crashing, they hit Docker Hub's anonymous pull limit. 130 images is more than the 100 pulls an hour Docker Hub allows per IP, and that limit is shared with my nodes and CI runners. Scans now log in with a read-only token.
Then I could start on the actual vulnerabilities. A surprising number of them came from tools that had no business being in a production image. Every Python image shipped pip and every Node image shipped npm, and neither runs once the image is built. Removing them took out a whole batch of findings at once. My Alpine images got an apk upgrade during the build, and for my background workers Renovate now bumps the base image and the Python version together so they can't drift apart.
Plenty is still red. A lot of what's left is in upstream images where the fix doesn't exist yet, so all I can do is check again in a week. I made an issue for it so I don't forget.
Is it overkill for a homelab? Probably. But I'd been running all of this on faith. Now I can see the list, and it's getting shorter.
Please log in to add a comment.