Staying Secure & Up to Date – Part 4: Scanning Containers with Trivy (Beginner, Real Examples)
“My Docker service is running – what could possibly be wrong?”
Here’s the interesting part. A running container is like a packed suitcase: the programs inside were built at a specific point in time and packed in. Containers do not update themselves – if your image is four months old, it contains the software states of four months ago (including flaws known then). That’s exactly what Trivy checks.
The scan command for your containers
On the host where your containers run:
trivy image --severity HIGH,CRITICAL <image-name>
Example (scanning one specific service):
trivy image --severity HIGH,CRITICAL minio/minio:RELEASE.2025-09-07
Trivy will show something like this:
┌──────────────┬───────────────────┬──────────┬──────────────────────────┐ │ Package │ Vulnerability │ Severity │ Fixed Version │ ├──────────────┼───────────────────┼──────────┼──────────────────────────┤ │ SomeLibrary │ CVE-2026-33322 │ CRITICAL │ RELEASE.2026-03-17 │ │ ... │ ... │ ... │ ... │ └──────────────┴───────────────────┴──────────┴──────────────────────────┘ Total: 7 (HIGH: 6, CRITICAL: 1)
How to read this:
• Package – which library inside the image is affected
• Vulnerability – the CVE ID (your “error letter” from part 1)
• Severity – CRITICAL / HIGH / MEDIUM / LOW
• Fixed Version – the most important column: the version that fixes it
Real examples from my check (November 2026)
Example 1: A service that “just ran” for far too long. My object-storage service
MinIO had not been updated for over a year (image from September 2025). The scan
reported CVE-2026-33322 (9.8/CRITICAL) – a flaw in the login check. The fix was simple: pull
the newer image and restart with the new tag. The case taught me one thing: a service can work
for years and still be outdated. That’s why you check regularly, not only when something breaks.
Example 2: A finding that shows up “everywhere”. Almost every image contained
CVE-2026-111497 (a compression library called Brotli, on the KEV list –
i.e. actively exploited). Fixing “one service” didn’t help – we had to re-pull all images
containing that library. That’s exactly why part 5 automates a weekly scan.
Example 3: “Fixed Version empty” – what now? Sometimes Trivy shows a finding without a fixed version. That means there is simply no fixed image yet (upstream hasn’t shipped). Document it, check real exposure, and wait for the next update. No reason to panic – but a reason not to delete the alert.
What if an update briefly “breaks” something?
When you update an image, there can be short interruptions – we once had a database login error right after an update (the container got a new network address). Such transition quirks are normal and usually fixed within minutes. The key rules:
• Before: close open sessions, maybe take a backup snapshot (one click on Proxmox)
• During: watch readable logs (“what is the service saying?”)
• After: check health + logs (Docker shows (healthy) or
(unhealthy))
Pro Corner
• Scan all local images in a loop (the basis of the weekly script from part 5):
for img in $(docker ps --format '{{.Image}}' | sort -u); do
trivy image --severity HIGH,CRITICAL --no-progress "$img"
done
• --ignore-unfixed: hides findings without a fixed version – useful to
focus on fixable noise; use consciously.
• Digest instead of tags: pin image digests
(sha256:…) for reproducibility.
• SBOM export: trivy image --format cyclonedx <image> produces the
software bill of materials for audits.
• Cache on disk: on VMs /tmp is often RAM-backed (tmpfs) and fills up
with large images – set TRIVY_CACHE_DIR=/var/cache/trivy.
Why this matters: your first Trivy result is like a health check – better know the list and work it than discover years later a service that has been unpatched for 14 months.
Next part: Part 5 – Automation: weekly scan & Telegram alerts.