Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Red Hat Developer 8 min read Case study mediumAdept

Chasing CVEs: Lessons from a real container build using Red Hat Hardened Images

Rebuilding the Pi-hole container (shell, compiled C FTL, and JavaScript) on Red Hat Hardened Images' minimal core-runtime surfaced several practical lessons for distroless-style builds. Installing RPMs into a separate installroot and copying it over duplicates packages and overwrites the rpmdb, so scanners see something very different from the base. Using RUN --mount to bind the core-runtime builder image and run its dnf against the final stage keeps the rpmdb accurate, so grype matches added packages to CVE feeds correctly. Other lessons: create Busybox symlinks at build time rather than patching scripts, use a small sidecar container to inspect packages, track upstream releases, base images and individually added RPMs with Renovate, and add functional tests for the DNS pod.

Assumes: Containerfile/Dockerfile basicsmulti-stage buildsRPM and dnf

Related posts

  • From Security Blocked to Prod Ready: ClickHouse on Docker Hardened Images

    Docker mediumAdept

    Security scanners block the standard ClickHouse image because its Ubuntu 22.04 base ships unused packages carrying unpatched CVEs, such as wget (CVE-2021-31879) and tar. Docker Hardened Images remove apt, wget, curl and other unneeded packages. They run as non-root uid 65532, ship SLSA Level 3 provenance with VEX attestations, and come in dev and runtime variants. A Docker Scout comparison shows all medium-severity findings eliminated, with only unfixable low findings in glibc and openssl remaining. The guide covers docker run setup, custom XML config, Kubernetes fsGroup settings, a smaller metrics exporter (10.3 MB vs 29.4 MB), and debugging with docker debug in place of in-container tools.

  • Secure by Design: A Proactive Testing Approach with Testcontainers, Docker Scout, and Hardened Images

    Docker mediumAdept

    Swapping a Node.js API's node:22-slim base image for a Docker Hardened Image (distroless dhi-node:22) eliminated all critical and high CVEs flagged by Docker Scout, including Debian 12's CVE-2025-6020, while avoiding the musl compatibility risk of switching to Alpine. The walkthrough builds images with SBOM and provenance attestations via buildx, scans and compares them with Docker Scout, and uses -dev and runtime DHI variants in a multi-stage Dockerfile. The image shrank from 80 MB and 427 packages to 41 MB and 123 packages. Testcontainers-based API tests against real Postgres confirm the app still works in under 20 seconds, and VEX attestations can be exported for external scanners like Grype or Trivy.

  • Making the Most of Your Docker Hardened Images Enterprise Trial – Part 1

    Docker mediumAdept

    Docker Hardened Images (DHI) strip base images down to the minimum runtime, removing package managers, shells and utilities while keeping distro compatibility. They come in standard, dev and FIPS variants. An Enterprise trial walkthrough covers mirroring images into an org namespace, swapping the Dockerfile FROM line, handling common build failures with multi-stage builds, and comparing results with Docker Scout. For a Node.js image, the hardened base cut CVEs from 25 to 0, packages from 321 to 32, and size from 82 MB to 48 MB, and it ships an embedded SBOM exportable as SPDX or CycloneDX.

  • The Supply Chain Paradox: When “Hardened” Images Become a Vendor Lock-in Trap

    Docker easyNovice

    Pre-hardened container images reduce attack surface but can create a subtle vendor lock-in. The causes include custom Linux bases, broken compatibility with standard tooling and CI/CD, configuration lockdown, and hardening knowledge concentrated inside the vendor. The proposed evaluation framework asks platform teams to require images built on mainstream distributions (Debian, Ubuntu, Alpine, RHEL) with standard package managers and FHS layout, modular and overridable hardening layers, upstream contributions, and verifiable vulnerability disclosure, SBOMs and reproducible builds. It also calls for bidirectional migration tooling so that switching vendors stays a choice rather than a crisis.

  • Hardened Images Explained: Fewer CVEs, Smaller Attack Surface

    Docker easyNovice

    Most container CVEs come from unused packages in general-purpose base images (often 400+ packages when an app needs 20–30), not application code. Hardened images address this with three properties: aggressive minimization (no shells, package managers or debug tools), continuous patching on defined SLAs, and verifiable supply chain metadata such as SBOMs, SLSA provenance, VEX data and signatures that enable CI policy gates. Container hardening works at the image layer and differs from VM/CIS OS hardening. Slim, Alpine or one-off distroless images alone don't qualify, and the piece closes by promoting Docker Hardened Images, with a free Apache 2.0 Community tier.

The quest for software engineering knowledge.

Look:
Layout: