Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions container/api.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions container/db.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions container/streamlit.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/test_container_image_hardening.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Loading