diff --git a/container/api.Dockerfile b/container/api.Dockerfile index fc6d9a1..7445e64 100644 --- a/container/api.Dockerfile +++ b/container/api.Dockerfile @@ -12,11 +12,11 @@ ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ PIP_NO_CACHE_DIR=1 -# Debian's security update for the package the image scan flagged (#326): zlib1g. The base image -# is rebuilt only now and then; the fix is in Debian's archive sooner. Only the named package is +# Debian's security update for the packages the image scan flagged (#326): zlib1g and libzstd1. The base image +# is rebuilt only now and then; the fix is in Debian's archive sooner. Only the named packages are # upgraded, and the line does nothing once the base image carries the fix. RUN apt-get update \ - && apt-get install -y --no-install-recommends --only-upgrade zlib1g \ + && apt-get install -y --no-install-recommends --only-upgrade zlib1g libzstd1 \ && rm -rf /var/lib/apt/lists/* RUN useradd --system --uid 10001 --create-home --home-dir /home/app app diff --git a/container/db.Dockerfile b/container/db.Dockerfile index 9fce7b6..dcae1ca 100644 --- a/container/db.Dockerfile +++ b/container/db.Dockerfile @@ -32,13 +32,13 @@ RUN set -eux; \ FROM postgres:16@sha256:3950ad7c3148ca2175ef1b6c36c9efbf78957ae8fbe8b3a5d7c35af50500382f -# Debian's security updates for the packages the image scan flagged (#326): zlib1g and the +# Debian's security updates for the packages the image scan flagged (#326): zlib1g, zstd and the # Kerberos libraries. The base image is rebuilt only now and then; the fixes are in Debian's # archive sooner. Only the named packages are upgraded (a blanket upgrade could move PostgreSQL # itself), and the line does nothing once the base image carries the fixes. RUN apt-get update \ && apt-get install -y --no-install-recommends --only-upgrade \ - zlib1g libgssapi-krb5-2 libkrb5-3 libk5crypto3 libkrb5support0 \ + zlib1g libzstd1 zstd libgssapi-krb5-2 libkrb5-3 libk5crypto3 libkrb5support0 \ && rm -rf /var/lib/apt/lists/* # The rebuilt gosu replaces the official one at the same path (docker-entrypoint.sh calls it diff --git a/container/streamlit.Dockerfile b/container/streamlit.Dockerfile index db90ae3..45c0220 100644 --- a/container/streamlit.Dockerfile +++ b/container/streamlit.Dockerfile @@ -11,9 +11,9 @@ ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ PIP_NO_CACHE_DIR=1 -# Same Debian security update as the API image (#326): zlib1g. Does nothing once the base image carries the fix. +# Same Debian security update as the API image (#326): zlib1g and libzstd1. Does nothing once the base image carries the fix. RUN apt-get update \ - && apt-get install -y --no-install-recommends --only-upgrade zlib1g \ + && apt-get install -y --no-install-recommends --only-upgrade zlib1g libzstd1 \ && rm -rf /var/lib/apt/lists/* RUN useradd --system --uid 10001 --create-home --home-dir /home/app app diff --git a/tests/unit/test_container_image_hardening.py b/tests/unit/test_container_image_hardening.py index 9c1a90d..ad41f81 100644 --- a/tests/unit/test_container_image_hardening.py +++ b/tests/unit/test_container_image_hardening.py @@ -90,8 +90,9 @@ def test_nothing_in_the_container_start_up_needs_npm(): @pytest.mark.parametrize("image, packages", [ - ("api.Dockerfile", ["zlib1g"]), - ("db.Dockerfile", ["zlib1g", "libgssapi-krb5-2", "libkrb5-3", "libk5crypto3", "libkrb5support0"]), + ("api.Dockerfile", ["zlib1g", "libzstd1"]), + ("streamlit.Dockerfile", ["zlib1g", "libzstd1"]), + ("db.Dockerfile", ["zlib1g", "libzstd1", "zstd", "libgssapi-krb5-2", "libkrb5-3", "libk5crypto3", "libkrb5support0"]), ]) def test_the_debian_packages_the_scan_flagged_are_upgraded(image, packages): items = joined(dockerfile(image))