OCImendby CloudTrace

How to fix CVEs in Ubuntu container images

Short answer

Ubuntu images are fixed by apt-get upgrade from the security pocket of a supported LTS release. Some fixes for packages in universe are published only to Ubuntu Pro (ESM) subscribers; without it those CVEs stay. Use a supported LTS and remove packages the application does not use.

Fix a Ubuntu image now → free, no sign-up; pre-filled with ubuntu:24.04, change it to yours

The steps

  1. 01apt-get upgradeFixes from the security pocket of your release.
  2. 02Supported LTSInterim releases are supported for nine months only.
  3. 03Know what needs ProSome universe fixes are published to ESM only.
  4. 04Remove what is not usedFewer packages, fewer CVEs to wait for.

By hand

FROM ubuntu:24.04
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*

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

Ubuntu images in OCImend's reports

Questions

How do I fix CVEs in a Ubuntu container image?
Ubuntu images are fixed by apt-get upgrade from the security pocket of a supported LTS release. Some fixes for packages in universe are published only to Ubuntu Pro (ESM) subscribers; without it those CVEs stay. Use a supported LTS and remove packages the application does not use.
Do I need Ubuntu Pro to patch my image?
Not for main; some universe fixes are published to Pro only.
Which Ubuntu base for containers?
The current LTS, with only the packages the app needs.

Other image types

Python · Node.js · Java · Go · nginx · PostgreSQL · Alpine · Debian · Red Hat UBI

Fix a Ubuntu image now →