OCImendby CloudTrace

How to fix CVEs in Red Hat UBI container images

Short answer

Red Hat Universal Base Images are fixed by dnf upgrade (microdnf on ubi-minimal) from Red Hat's errata. Use the newest UBI minor release, upgrade packages in your layer, and prefer ubi-minimal or ubi-micro for runtime images; for FIPS, UBI switches FIPS mode on when the host is in FIPS mode.

Fix a Red Hat UBI image now → free, no sign-up; pre-filled with registry.access.redhat.com/ubi9/ubi-minimal, change it to yours

The steps

  1. 01Upgrade packagesdnf upgrade -y, or microdnf upgrade -y on minimal images.
  2. 02Newest UBI minorRed Hat rebuilds UBI images as errata are published.
  3. 03Minimal runtimeubi-minimal or ubi-micro: fewer packages.
  4. 04FIPS needs the hostUBI's FIPS mode follows the host kernel's FIPS mode.

By hand

FROM registry.access.redhat.com/ubi9/ubi-minimal
RUN microdnf upgrade -y && microdnf clean all

Then rescan: the CVEs that remain are either without a released fix or in code the application never loads (the report marks both).

Traps that bring CVEs back

Red Hat UBI images in OCImend's reports

Questions

How do I fix CVEs in a Red Hat UBI container image?
Red Hat Universal Base Images are fixed by dnf upgrade (microdnf on ubi-minimal) from Red Hat's errata. Use the newest UBI minor release, upgrade packages in your layer, and prefer ubi-minimal or ubi-micro for runtime images; for FIPS, UBI switches FIPS mode on when the host is in FIPS mode.
Is UBI free to redistribute?
Yes, under the UBI end-user licence agreement.
How do I make a UBI image FIPS-enabled?
Run it on a FIPS-mode host, or use an image that enforces FIPS mode inside.

Other image types

Python · Node.js · Java · Go · nginx · PostgreSQL · Alpine · Debian · Ubuntu

Fix a Red Hat UBI image now →