Skip to content

dhi#1

Closed
mathieu-benoit wants to merge 5 commits into
masterfrom
dhi
Closed

dhi#1
mathieu-benoit wants to merge 5 commits into
masterfrom
dhi

Conversation

@mathieu-benoit
Copy link
Copy Markdown
Owner

@mathieu-benoit mathieu-benoit commented Apr 29, 2026

Objective: Proposing a new variant -distroless for the Microcks CLI's end users in addition to the existing one. This allows to have a minimal and distroless image alternative of the existing one. No breaking change, and just a secure by default and design option.

tl,dr - With DHI it's:

  • 132 packages less
  • 150MB on disk less
  • 22 CVEs less
  • distroless (no unnecessary package manager, bash, curl, etc.)
docker build -t microcks-cli:master -f build/Dockerfile .
docker build -t microcks-cli:dhi -f build/Dockerfile.dhi .

docker images microcks-cli
image
IMAGE                 ID             DISK USAGE   CONTENT SIZE   EXTRA
microcks-cli:dhi      b3a1707a7f35       14.8MB         3.92MB        
microcks-cli:master   2649946d8952        164MB         43.7MB

docker scout compare --to microcks-cli:master microcks-cli:dhi:

    ✓ Image stored for indexing
    ✓ Indexed 38 packages
    ✓ Provenance obtained from attestation
    ✓ Image stored for indexing
    ✓ Indexed 170 packages
    ✓ Provenance obtained from attestation
    ✓ Policy evaluation completed
    ✓ Policy evaluation completed


  ## Overview

                     │                 Analyzed Image                 │                Comparison Image
  ───────────────────┼────────────────────────────────────────────────┼────────────────────────────────────────────────
   Target            │  microcks-cli:dhi                              │  microcks-cli:master
     digest          │  b3a1707a7f35                                  │  2649946d8952
     tag             │  dhi                                           │  master
     platform        │ linux/amd64                                    │ linux/amd64
     provenance      │ https://github.com/mathieu-benoit/microcks-cli │ https://github.com/mathieu-benoit/microcks-cli
                     │  8fa70d860270ee8f8e1b520c5356bb1f957187bb      │  8d199c9d321a466f6f63f5cb932d4628bb5f9d37
     vulnerabilities │    0C     2H     1M     0L                     │    0C    11H    12M     2L
                     │           -9    -11     -2                     │
     size            │ 3.9 MB (-40 MB)                                │ 44 MB
     packages        │ 38 (-132)                                      │ 170
                     │                                                │


  ## Environment Variables


    - CLI=/usr/local/bin/microcks
      PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    + SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
    - USER_NAME=microcks-cli
    - USER_UID=1001
    - container=oci



  ## Labels


    - architecture=x86_64
    - build-date=2026-04-22T04:58:33Z
    + com.docker.dhi.chain-id=sha256:f43a64a13461e634afe414e20d51436d7d635e8e830fd81cc6bd05dbdef6433b
    + com.docker.dhi.compliance=cis
    + com.docker.dhi.created=2026-04-15T17:06:34Z
    + com.docker.dhi.definition=image/static/alpine-3.23/static
    + com.docker.dhi.distro=alpine-3.23
    + com.docker.dhi.entitlement=public
    + com.docker.dhi.flavor=
    + com.docker.dhi.name=dhi/static
    + com.docker.dhi.package-manager=
    + com.docker.dhi.shell=
    + com.docker.dhi.title=Static (Alpine)
    + com.docker.dhi.url=https://dhi.io/catalog/static
    + com.docker.dhi.variant=runtime
    + com.docker.dhi.version=20260413-alpine3.23
    - com.redhat.component=ubi9-minimal-container
    - com.redhat.license_terms=https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI
    - cpe=cpe:/a:redhat:enterprise_linux:9::appstream
    - description=The Universal Base Image Minimal is a stripped down image that uses microdnf as a package manager. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.
    - distribution-scope=public
      io.artifacthub.package.readme-url=https://raw.githubusercontent.com/microcks/microcks-cli/master/README.md
    - io.buildah.version=1.42.2
    - io.k8s.description=The Universal Base Image Minimal is a stripped down image that uses microdnf as a package manager. This base image is freely redistributable, but Red Hat only supports Red Hat technologies through subscriptions for Red Hat products. This image is maintained by Red Hat and updated regularly.
    - io.k8s.display-name=Red Hat Universal Base Image 9 Minimal
    - io.openshift.expose-services=
    - io.openshift.tags=minimal rhel9
      maintainer=Laurent Broudoux <laurent@microcks.io>
    - name=ubi9/ubi-minimal
      org.opencontainers.image.authors=Laurent Broudoux <laurent@microcks.io>
    - org.opencontainers.image.created=2026-04-22T04:58:33Z
      org.opencontainers.image.description=Microcks is Open Source cloud-native native tool for API Mocking and Testing
      org.opencontainers.image.documentation=https://github.com/microcks/microcks-cli
      org.opencontainers.image.licenses=Apache-2.0
    - org.opencontainers.image.revision=5bb1e5f6eb0dd42dce5d2f21f64a3a9feec995f1
      org.opencontainers.image.title=Microcks CLI
    - release=1776833838
    - summary=Provides the latest release of the minimal Red Hat Universal Base Image 9.
    - url=https://catalog.redhat.com/en/search?searchType=containers
    - vcs-ref=5bb1e5f6eb0dd42dce5d2f21f64a3a9feec995f1
    - vcs-type=git
    - vendor=Red Hat, Inc.
    - version=9.7



  ## Config


    - cmd=/bin/bash
    + cmd=
    - user=1001
    + user=nonroot
      workdir=/



  ## Policies


  0 improved, 0 worsened, 2 missing data

    Policy                                       Analyzed   Comparison  Change

    Default non-root user                        ✓          ✓                   No Change
    No AGPL v3 licenses                          ✓          ✓                   No Change
    No fixable critical or high vulnerabilities  ! 1        ! 1                 No Change
    No high-profile vulnerabilities              ✓          ✓                   No Change
    No outdated base images                      ? No data  ? No data
    No unapproved base images                    ? No data  ? No data
    Supply chain attestations                    ! 1        ! 1                 No Change

      View policy details → docker scout policy microcks-cli:dhi


  ## Packages and Vulnerabilities


    +    6 packages added
    -  137 packages removed
        32 packages unchanged


    - 22 vulnerabilities removed


     Package                                                        Type    Version                            Compared Version

  -  acl                                                            rpm                                        2.3.1-4.el9
  +  alpine-baselayout                                              apk     3.7.2-r0
  +  alpine-baselayout-data                                         apk     3.7.2-r0
  -  alternatives                                                   rpm                                        1.24-2.el9
  -  attr                                                           rpm                                        2.5.1-3.el9
  -  audit                                                          rpm                                        3.1.5-7.el9
  -  audit-libs                                                     rpm                                        3.1.5-7.el9
  -  basesystem                                                     rpm                                        11-13.el9
  -  bash                                                           rpm                                        5.1.8-9.el9
  -  bzip2                                                          rpm                                        1.0.8-10.el9_5
  -  bzip2-libs                                                     rpm                                        1.0.8-10.el9_5
  -  ca-certificates                                                rpm                                        2024.2.69_v8.0.303-91.4.el9_4
  +  ca-certificates                                                apk     20260413-r0
  +  ca-certificates-bundle                                         apk     20260413-r0
  -  chkconfig                                                      rpm                                        1.24-2.el9
  -  coreutils                                                      rpm                                        8.32-39.el9
  -  coreutils-single                                               rpm                                        8.32-39.el9
  -  crypto-policies                                                rpm                                        20250905-1.git377cc42.el9_7
  -  curl                                                           rpm                                        7.76.1-35.el9_7.3
     └─  -  MEDIUM       CVE-2025-9086   [https://scout.docker.com/v/CVE-2025-9086]
                         5.3  Out-of-bounds Read

  -  curl-minimal                                                   rpm                                        7.76.1-35.el9_7.3
  -  cyrus-sasl                                                     rpm                                        2.1.27-22.el9
  -  cyrus-sasl-lib                                                 rpm                                        2.1.27-22.el9
  -  dejavu-fonts                                                   rpm                                        2.37-18.el9
  -  dejavu-sans-fonts                                              rpm                                        2.37-18.el9
  -  dnf                                                            rpm                                        4.14.0-31.el9
  -  dnf-data                                                       rpm                                        4.14.0-31.el9
  -  e2fsprogs                                                      rpm                                        1.46.5-8.el9
  -  file                                                           rpm                                        5.39-16.el9
  -  file-libs                                                      rpm                                        5.39-16.el9
  -  filesystem                                                     rpm                                        3.16-5.el9
  -  fonts-filesystem                                               rpm                                        1:2.0.5-7.el9.1
  -  fonts-rpm-macros                                               rpm                                        1:2.0.5-7.el9.1
  -  gawk                                                           rpm                                        5.1.0-6.el9
  -  gcc                                                            rpm                                        11.5.0-11.el9
  -  gdbm                                                           rpm                                        1:1.23-1.el9
  -  gdbm-libs                                                      rpm                                        1:1.23-1.el9
     github.com/containerd/errdefs                                  golang  1.0.0                              1.0.0
     github.com/containerd/errdefs/pkg                              golang  0.3.0                              0.3.0
     github.com/coreos/go-oidc/v3                                   golang  3.15.0                             3.15.0
     github.com/distribution/reference                              golang  0.6.0                              0.6.0
     github.com/docker/docker                                       golang  28.5.1+incompatible                28.5.1+incompatible
     github.com/docker/go-connections                               golang  0.6.0                              0.6.0
     github.com/docker/go-units                                     golang  0.5.0                              0.5.0
     github.com/felixge/httpsnoop                                   golang  1.0.4                              1.0.4
     github.com/fsnotify/fsnotify                                   golang  1.9.0                              1.9.0
     github.com/go-jose/go-jose/v4                                  golang  4.0.5                              4.0.5
     github.com/go-logr/logr                                        golang  1.4.2                              1.4.2
     github.com/go-logr/stdr                                        golang  1.2.2                              1.2.2
     github.com/golang-jwt/jwt/v4                                   golang  4.5.2                              4.5.2
     github.com/microcks/microcks-cli                               golang  UNKNOWN                            UNKNOWN
     github.com/moby/docker-image-spec                              golang  1.3.1                              1.3.1
     github.com/opencontainers/go-digest                            golang  1.0.0                              1.0.0
     github.com/opencontainers/image-spec                           golang  1.1.1                              1.1.1
     github.com/pkg/errors                                          golang  0.9.1                              0.9.1
     github.com/skratchdot/open-golang                              golang  0.0.0-20200116055534-eef842397966  0.0.0-20200116055534-eef842397966
     github.com/spf13/cobra                                         golang  1.10.2                             1.10.2
     github.com/spf13/pflag                                         golang  1.0.9                              1.0.9
  -  glib2                                                          rpm                                        2.68.4-18.el9_7.1
     ├─  -  MEDIUM       CVE-2025-13601  [https://scout.docker.com/v/CVE-2025-13601]
     │                   7.7  Integer Overflow or Wraparound
     └─  -  LOW          CVE-2025-7039   [https://scout.docker.com/v/CVE-2025-7039]
                         3.7

  -  glibc                                                          rpm                                        2.34-231.el9_7.10
     ├─  -  HIGH         CVE-2026-0861   [https://scout.docker.com/v/CVE-2026-0861]
     │                   9.8  Integer Overflow or Wraparound
     ├─  -  HIGH         CVE-2026-4046   [https://scout.docker.com/v/CVE-2026-4046]
     │                   7.5  Reachable Assertion
     ├─  -  MEDIUM       CVE-2026-0915   [https://scout.docker.com/v/CVE-2026-0915]
     │                   5.3  Use of Uninitialized Resource
     └─  -  LOW          CVE-2025-15281  [https://scout.docker.com/v/CVE-2025-15281]
                         5.9  Use of Uninitialized Resource

  -  glibc-common                                                   rpm                                        2.34-231.el9_7.10
  -  glibc-minimal-langpack                                         rpm                                        2.34-231.el9_7.10
  -  gmp                                                            rpm                                        1:6.2.0-13.el9
  -  gnupg2                                                         rpm                                        2.3.3-5.el9_7
     ├─  -  HIGH         CVE-2026-24882  [https://scout.docker.com/v/CVE-2026-24882]
     │                   8.4  Stack-based Buffer Overflow
     ├─  -  HIGH         CVE-2026-24881  [https://scout.docker.com/v/CVE-2026-24881]
     │                   8.1  Stack-based Buffer Overflow
     └─  -  HIGH         CVE-2025-68973  [https://scout.docker.com/v/CVE-2025-68973]
                         7.8  Multiple Operations on Resource in Single-Operation Context

  -  gnutls                                                         rpm                                        3.8.3-10.el9_7
     └─  -  MEDIUM       CVE-2025-14831  [https://scout.docker.com/v/CVE-2025-14831]
                         5.3  Inefficient Algorithmic Complexity

     go.opentelemetry.io/auto/sdk                                   golang  1.1.0                              1.1.0
     go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp  golang  0.60.0                             0.60.0
     go.opentelemetry.io/otel                                       golang  1.35.0                             1.35.0
     go.opentelemetry.io/otel/metric                                golang  1.35.0                             1.35.0
     go.opentelemetry.io/otel/trace                                 golang  1.35.0                             1.35.0
  -  gobject-introspection                                          rpm                                        1.68.0-11.el9
     golang.org/x/crypto                                            golang  0.45.0                             0.45.0
     golang.org/x/oauth2                                            golang  0.36.0                             0.36.0
     golang.org/x/sys                                               golang  0.38.0                             0.38.0
     golang.org/x/term                                              golang  0.37.0                             0.37.0
     gopkg.in/yaml.v2                                               golang  2.4.0                              2.4.0
  -  gpg-pubkey                                                     rpm                                        fd431d51-4ae0493b
  -  gpgme                                                          rpm                                        1.15.1-6.el9
  -  grep                                                           rpm                                        3.6-5.el9
  -  json-c                                                         rpm                                        0.14-11.el9
  -  json-glib                                                      rpm                                        1.6.6-1.el9
  -  keyutils                                                       rpm                                        1.6.3-1.el9
  -  keyutils-libs                                                  rpm                                        1.6.3-1.el9
  -  krb5                                                           rpm                                        1.21.1-9.el9_7
     ├─  -  HIGH         CVE-2026-40356  [https://scout.docker.com/v/CVE-2026-40356]
     │                   5.9  Integer Underflow (Wrap or Wraparound)
     └─  -  MEDIUM       CVE-2026-40355  [https://scout.docker.com/v/CVE-2026-40355]
                         5.9  NULL Pointer Dereference

  -  krb5-libs                                                      rpm                                        1.21.1-9.el9_7
  -  langpacks                                                      rpm                                        3.0-16.el9
  -  langpacks-core-en                                              rpm                                        3.0-16.el9
  -  langpacks-core-font-en                                         rpm                                        3.0-16.el9
  -  langpacks-en                                                   rpm                                        3.0-16.el9
  -  libacl                                                         rpm                                        2.3.1-4.el9
  -  libarchive                                                     rpm                                        3.5.3-9.el9_7
     ├─  -  HIGH         CVE-2026-4424   [https://scout.docker.com/v/CVE-2026-4424]
     │                   7.5  Out-of-bounds Read
     └─  -  MEDIUM       CVE-2026-5121   [https://scout.docker.com/v/CVE-2026-5121]
                         0.0

  -  libassuan                                                      rpm                                        2.5.5-3.el9
  -  libattr                                                        rpm                                        2.5.1-3.el9
  -  libblkid                                                       rpm                                        2.37.4-21.el9_7
  -  libcap                                                         rpm                                        2.48-10.el9
  -  libcap-ng                                                      rpm                                        0.8.2-7.el9
  -  libcom_err                                                     rpm                                        1.46.5-8.el9
  -  libcurl-minimal                                                rpm                                        7.76.1-35.el9_7.3
  -  libdnf                                                         rpm                                        0.69.0-17.el9_7
  -  libevent                                                       rpm                                        2.1.12-8.el9_4
  -  libffi                                                         rpm                                        3.4.2-8.el9
  -  libgcc                                                         rpm                                        11.5.0-11.el9
  -  libgcrypt                                                      rpm                                        1.10.0-11.el9
  -  libgpg-error                                                   rpm                                        1.42-5.el9
  -  libidn2                                                        rpm                                        2.3.0-7.el9
  -  libksba                                                        rpm                                        1.5.1-7.el9
  -  libmodulemd                                                    rpm                                        2.13.0-2.el9
  -  libmount                                                       rpm                                        2.37.4-21.el9_7
  -  libnghttp2                                                     rpm                                        1.43.0-6.el9_7.1
  -  libpeas                                                        rpm                                        1.30.0-4.el9
  -  librepo                                                        rpm                                        1.14.5-3.el9
  -  libreport                                                      rpm                                        2.15.2-6.el9
  -  libreport-filesystem                                           rpm                                        2.15.2-6.el9
  -  librhsm                                                        rpm                                        0.0.3-9.el9
  -  libselinux                                                     rpm                                        3.6-3.el9
  -  libsemanage                                                    rpm                                        3.6-5.el9_6
  -  libsepol                                                       rpm                                        3.6-3.el9
  -  libsigsegv                                                     rpm                                        2.13-4.el9
  -  libsmartcols                                                   rpm                                        2.37.4-21.el9_7
  -  libsolv                                                        rpm                                        0.7.24-3.el9
  -  libstdc++                                                      rpm                                        11.5.0-11.el9
  -  libtasn1                                                       rpm                                        4.16.0-9.el9
     └─  -  MEDIUM       CVE-2025-13151  [https://scout.docker.com/v/CVE-2025-13151]
                         5.9  Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')

  -  libtool                                                        rpm                                        2.4.6-46.el9
  -  libtool-ltdl                                                   rpm                                        2.4.6-46.el9
  -  libunistring                                                   rpm                                        0.9.10-15.el9
  -  libusbx                                                        rpm                                        1.0.26-1.el9
  -  libuuid                                                        rpm                                        2.37.4-21.el9_7
  -  libverto                                                       rpm                                        0.3.2-3.el9
  -  libxcrypt                                                      rpm                                        4.4.18-3.el9
  -  libxml2                                                        rpm                                        2.9.13-14.el9_7
  -  libyaml                                                        rpm                                        0.2.5-7.el9
  -  libzstd                                                        rpm                                        1.5.5-1.el9
  -  lua                                                            rpm                                        5.4.4-4.el9
  -  lua-libs                                                       rpm                                        5.4.4-4.el9
  -  lz4                                                            rpm                                        1.9.3-5.el9
  -  lz4-libs                                                       rpm                                        1.9.3-5.el9
  -  microdnf                                                       rpm                                        3.9.1-3.el9
  -  mpfr                                                           rpm                                        4.1.0-7.el9
  -  ncurses                                                        rpm                                        6.2-12.20210508.el9
  -  ncurses-base                                                   rpm                                        6.2-12.20210508.el9
  -  ncurses-libs                                                   rpm                                        6.2-12.20210508.el9
  -  nettle                                                         rpm                                        3.10.1-1.el9
  -  nghttp2                                                        rpm                                        1.43.0-6.el9_7.1
     └─  -  HIGH         CVE-2026-27135  [https://scout.docker.com/v/CVE-2026-27135]
                         7.5  Reachable Assertion

  -  npth                                                           rpm                                        1.6-8.el9
  -  openldap                                                       rpm                                        2.6.8-4.el9
  -  openssl                                                        rpm                                        1:3.5.1-7.el9_7
     ├─  -  MEDIUM       CVE-2026-28390  [https://scout.docker.com/v/CVE-2026-28390]
     │                   7.5  NULL Pointer Dereference
     └─  -  MEDIUM       CVE-2026-31790  [https://scout.docker.com/v/CVE-2026-31790]
                         5.9  Access of Uninitialized Pointer

  -  openssl-fips-provider                                          rpm                                        3.0.7-8.el9
  -  openssl-fips-provider-so                                       rpm                                        3.0.7-8.el9
  -  openssl-libs                                                   rpm                                        1:3.5.1-7.el9_7
  -  p11-kit                                                        rpm                                        0.25.3-3.el9_5
  -  p11-kit-trust                                                  rpm                                        0.25.3-3.el9_5
  -  pcre                                                           rpm                                        8.44-4.el9
  -  pcre2                                                          rpm                                        10.40-6.el9
  -  pcre2-syntax                                                   rpm                                        10.40-6.el9
  -  popt                                                           rpm                                        1.18-8.el9
  -  readline                                                       rpm                                        8.1-4.el9
  -  redhat-release                                                 rpm                                        9.7-0.7.el9
  -  rootfiles                                                      rpm                                        8.1-35.el9
  -  rpm                                                            rpm                                        4.16.1.3-39.el9
  -  rpm-libs                                                       rpm                                        4.16.1.3-39.el9
  -  sed                                                            rpm                                        4.8-9.el9
  -  setup                                                          rpm                                        2.13.7-10.el9
  -  shadow-utils                                                   rpm                                        2:4.9-15.el9
  -  sqlite                                                         rpm                                        3.34.1-9.el9_7
  -  sqlite-libs                                                    rpm                                        3.34.1-9.el9_7
  +  static                                                         docker  20260413-alpine3.23
     stdlib                                                         golang  1.25.9                             1.25.9
  -  systemd                                                        rpm                                        252-55.el9_7.8
     └─  -  MEDIUM       CVE-2026-29111  [https://scout.docker.com/v/CVE-2026-29111]
                         7.8  Improper Validation of Specified Type of Input

  -  systemd-libs                                                   rpm                                        252-55.el9_7.8
  +  tzdata                                                         apk     2026a-r0
  -  tzdata                                                         rpm                                        2026a-1.el9
  -  util-linux                                                     rpm                                        2.37.4-21.el9_7
     └─  -  MEDIUM       CVE-2025-14104  [https://scout.docker.com/v/CVE-2025-14104]
                         6.1  Out-of-bounds Read

  -  xz                                                             rpm                                        5.2.5-8.el9_0
  -  xz-libs                                                        rpm                                        5.2.5-8.el9_0
  -  zlib                                                           rpm                                        1.2.11-40.el9
     └─  -  HIGH         CVE-2026-22184  [https://scout.docker.com/v/CVE-2026-22184]
                         8.6  Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')

  -  zstd                                                           rpm                                        1.5.5-1.el9

Tested these successfully:

docker run --rm -it microcks-cli:master microcks version
docker run --rm -it microcks-cli:dhi microcks version

docker run --rm -it microcks-cli:master microcks help
docker run --rm -it microcks-cli:dhi microcks help

To check:

  • USER from 1001 to 65532, is that an issue?
  • dhi.io/static:alpine was chosen, but JFYI dhi.io/static:debian exists too

Note: the 3 CVEs remaining with the DHI images are just about go packages to update, they are also in the master/ubi image:

  • 0C 1H 1M 0L - github.com/docker/docker 28.5.1
  • 0C 1H 0M 0L - github.com/go-jose/go-jose/v4 4.0.5

Signed-off-by: Mathieu Benoit <mathieu-benoit@hotmail.fr>
Signed-off-by: Mathieu Benoit <mathieu-benoit@hotmail.fr>
Signed-off-by: Mathieu Benoit <mathieu-benoit@hotmail.fr>
Signed-off-by: Mathieu Benoit <mathieu-benoit@hotmail.fr>
@mathieu-benoit
Copy link
Copy Markdown
Owner Author

Done officially there microcks#354 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant