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
- 01Upgrade packagesdnf upgrade -y, or microdnf upgrade -y on minimal images.
- 02Newest UBI minorRed Hat rebuilds UBI images as errata are published.
- 03Minimal runtimeubi-minimal or ubi-micro: fewer packages.
- 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
- ubi-micro has no package manager: patch it by rebuilding on a newer micro image.
- A FIPS PASS on a non-FIPS host is not possible for UBI: run on FIPS-enabled nodes or use a FIPS-enforced image.
Red Hat UBI images in OCImend's reports
| Image | Grade | Known CVEs | |
|---|---|---|---|
| registry.access.redhat.com/ubi9/ubi:9.9-1795197514-source | A | 0 | Fix |
| registry.access.redhat.com/ubi9/ubi-minimal:9.9-1795198179-source | A | 0 | Fix |
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