Skip to content

Get notified

Get an email when a new major security incident drops. No spam, unsubscribe any time.

Only used for pwn.watch incident emails. Protected by Cloudflare Turnstile.

Cloud, TLS & Containers8 min read

Container & Kubernetes CVE Scanning Without Alert Fatigue

Cut container CVE noise by 80%+: shrink base images with multi-stage distroless builds, pin @sha256 digests, filter by fix availability & KEV, and harden Kubernetes workloads.

// key takeaways

  • You cannot triage your way out of a bloated base image — switching to multi-stage distroless, scratch, Nix, or minimal Alpine bases removes 80%+ of OS CVE noise before scanning even starts.
  • Gate pull requests only on fixable Critical/High vulnerabilities (or CISA KEV matches) so CI never blocks deploys over unfixable upstream 'won't-fix' Debian/glibc entries.
  • Store one CycloneDX SBOM per pushed image digest and rescan stored SBOMs continuously when new CVEs drop instead of rebuilding every container daily just to check exposure.
  • Prioritize Kubernetes ingress controllers, admission webhooks, and CRD operators — they sit directly on external trust boundaries and drive the highest-impact cluster compromises.

Cut 80% of scanner noise at the source: shrink your runtime image

Teams often turn on Trivy, Grype, or Docker Scout against an existing node:22 or python:3.12 full Debian base image, get hit with 350 OS-layer CVEs on day one, and immediately switch the CI gate to soft-fail forever. Almost all of that noise comes from packages your application never executes — compilers, shells, curl, perl, image libraries, and man pages sitting inside the runtime container.

Move compilation and package builds into a builder stage, copy only the final compiled binary or pruned production bundle into a minimal runtime image (distroless, scratch, Chainguard/Wolfi, Alpine, or a reproducible Nix closure), and pin the base image by immutable @sha256 digest.

Hardened multi-stage Dockerfile + high-signal Trivy scan
# Scan built image: fail CI only on fixable CRITICAL/HIGH bugs, emit CycloneDX SBOM
trivy image --ignore-unfixed --severity CRITICAL,HIGH --exit-code 1 ghcr.io/org/api:build-123
trivy image --format cyclonedx --output sbom-api.cdx.json ghcr.io/org/api:build-123

# Pin base images by immutable digest instead of mutable :latest tags
# FROM gcr.io/distroless/nodejs22-debian12@sha256:<verified-digest>
# USER nonroot:nonroot

Design CI & admission gates engineers respect

Nothing ruins DevSecOps credibility faster than blocking an urgent hotfix because of a disputed Low/Medium OS CVE that has no upstream patch available. Separate pull-request blocking gates from continuous vulnerability tracking:

  • PR blocking gate: Block only newly introduced fixable Critical/High CVEs (especially KEV-listed or internet-facing app dependencies) where an actionable version bump exists right now.
  • Scheduled base-image rebuilds: Rebuild and redeploy base images automatically once a week (or immediately on Linux/OpenSSL/runc advisories) so OS patches stay fresh without manual PR toil.
  • Continuous SBOM rescanning: Store the CycloneDX SBOM for every image running in production clusters and scan those manifests against fresh feeds every few hours — zero registry pulls, instant answer when a zero-day drops.
  • VEX suppressions with expiry dates: When a Critical finding is provably unreachable in your workload, record a time-boxed VEX / .trivyignore entry with a short rationale and 30–60 day review date.

Kubernetes CVE priority: ingress, operators, and runtime isolation

In real Kubernetes clusters, application pods are rarely the single highest-risk target. External ingress controllers (ingress-nginx, Envoy Gateway, Traefik), validating/mutating admission webhooks, and cluster-admin CRD operators frequently combine network reachability with elevated RBAC privileges — making a single vulnerability a cluster-wide compromise.

Assume a container CVE will eventually be exploited and constrain blast radius with defense-in-depth runtime defaults:

  • Enforce Kubernetes Pod Security Standards (restricted profile): runAsNonRoot: true, allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, and capabilities.drop: ['ALL'].
  • Never mount /var/run/docker.sock or host root filesystems into application workloads.
  • Apply default-deny NetworkPolicies between namespaces so a compromised frontend pod cannot reach cluster metadata APIs, internal databases, or kube-system webhooks.
  • Stay within the upstream Kubernetes N-2 supported minor release window and monitor both upstream feeds and your managed provider (EKS, GKE, AKS) node-image bulletins.

// actionable engineering checklist

  • Migrate production workloads to multi-stage minimal images pinned by @sha256

    Remove shells, compilers, and unused OS utilities from runtime containers to slash CVE counts and post-exploit tooling.

  • Gate CI on fixable Critical/High and KEV findings only

    Use --ignore-unfixed for PR gates while tracking unfixed risks separately with compensating controls.

  • Harden Pod Security specs and NetworkPolicies across every namespace

    Drop all Linux capabilities, run as non-root with a read-only rootfs, and block lateral pod traffic.

  • Track dedicated Docker and Kubernetes CVE hubs continuously

    Subscribe to /t/docker/feed.xml, /t/kubernetes/feed.xml, and /t/linux/feed.xml for runtime, runc, and ingress advisories.

// connected pwn.watch tools & live trackers

Frequently Asked Questions

Should we use Alpine or Distroless for minimal production containers?
Distroless (Debian-based, glibc, no shell/apk) avoids musl compatibility quirks with Python wheels (like NumPy) and Go/CGO binaries while giving attackers zero shell tools. Alpine is great for static Go/Rust binaries or lightweight tooling when musl is tested.
Why does Trivy report CVEs in packages my app never imports?
Image scanners inspect the OS package database (dpkg, apk, rpm) and language manifests across the entire filesystem, not live call graphs. Shrinking your base image and pairing scanners with reachability/VEX triage eliminates most of that noise.
How quickly should we patch ingress-nginx or runc vulnerabilities?
Treat internet-facing ingress controller and container-escape (runc/containerd) advisories as Tier 0 emergencies (24–48h SLA), since exploitation can grant cross-tenant or host-level compromise.

Get an email when a new major security incident drops. No spam, unsubscribe any time.