Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

fix(docker): address terrascan findings, drop apt-get upgrade

KaifAhmad1bf292ccbbc4a
diff --git a/.dockerignore b/.dockerignore
index d8283dfb..bcc2f0c4 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -6,6 +6,7 @@
!README.md
!LICENSE
!MANIFEST.in
+!requirements-ci.txt
!semantica/
!semantica/**
!integrations/
diff --git a/.github/workflows/container-scan.yml b/.github/workflows/container-scan.yml
index 0808bbaf..052c8a40 100644
--- a/.github/workflows/container-scan.yml
+++ b/.github/workflows/container-scan.yml
@@ -12,6 +12,7 @@ on:
- 'README.md'
- 'LICENSE'
- 'MANIFEST.in'
+ - 'requirements-ci.txt'
- 'semantica/**'
- 'integrations/**'
- 'explorer/**'
diff --git a/Dockerfile b/Dockerfile
index 50ad1ea4..93a044fb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,6 +9,17 @@ RUN npm ci
COPY explorer/ ./
RUN mkdir -p /app/semantica && npm run build
+# CVE-2026-14456 (OpenSSL QUIC-server DoS, flagged against this base image's
+# openssl/libssl3t64/openssl-provider-legacy): the Debian fix
+# (3.5.7-1~deb13u2) is only in trixie-proposed-updates as of this writing,
+# not yet promoted to trixie-security, so there's no package to pin here
+# today. Deliberately NOT running `apt-get upgrade` to chase it - that
+# breaks build reproducibility (terrascan AC_DOCKER_0052) and still
+# wouldn't reach a proposed-updates-only package. Once Debian ships the fix
+# and rebuilds this tag, the docker Dependabot ecosystem in
+# .github/dependabot.yml opens a PR bumping the digest pin above. Also: this
+# image only serves plain HTTP via uvicorn and never opens a QUIC listener,
+# so the bug isn't reachable here regardless.
FROM python:3.13-slim@sha256:7ce4b6dfe35e55397b7cda544f8a13f191b7ae28dc5aad71fe664dbc9bc2623f AS runtime
ENV PYTHONDONTWRITEBYTECODE=1 \
@@ -19,19 +30,6 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
WORKDIR /app
-# Pick up any Debian security-repo package fixes published after this base
-# image tag was built (e.g. CVE-2026-14456's openssl fix, which as of this
-# writing is still in trixie-proposed-updates and not yet promoted to
-# trixie-security - this step is a no-op today but will pick it up on the
-# next image rebuild once Debian ships it, without needing a Dockerfile
-# change). Note CVE-2026-14456 is a DoS in OpenSSL's QUIC *server* code path;
-# this image only serves plain HTTP via uvicorn and never opens a QUIC
-# listener, so it isn't reachable here even before the fix lands upstream.
-RUN apt-get update \
- && apt-get upgrade -y \
- && apt-get clean \
- && rm -rf /var/lib/apt/lists/*
-
RUN groupadd --system semantica \
&& useradd --system --gid semantica --home-dir /app --shell /usr/sbin/nologin semantica
@@ -42,15 +40,17 @@ COPY --from=frontend-builder /app/semantica/static ./semantica/static
# The base image ships an outdated setuptools (CVE-2025-47273); upgrade it
# explicitly since nothing in our own dependency tree otherwise pulls a
-# newer copy. requirements-ci.txt carries the audited, CVE-checked pins for
-# every transitive dependency (see security-scan.yml / security.yml) - feed
-# them in as an unhashed constraints file (pip's hash-checking mode rejects
-# the unhashable local source directory this installs) so the image lands
-# on the same patched versions CI verified, e.g. msgpack>=1.2.1, rather than
+# newer copy. Pinned to the exact version requirements-ci.txt/pyproject.toml
+# already build against, rather than a floor, per terrascan AC_DOCKER_0010.
+# requirements-ci.txt itself carries the audited, CVE-checked pins for every
+# transitive dependency (see security-scan.yml / security.yml) - feed them
+# in as an unhashed constraints file (pip's hash-checking mode rejects the
+# unhashable local source directory this installs) so the image lands on
+# the same patched versions CI verified, e.g. msgpack>=1.2.1, rather than
# letting pip freely re-resolve and pick up an unpatched transitive version.
# (Extracted with Python's re module rather than sed/grep so there's no
# line-continuation-backslash stripping to get subtly wrong.)
-RUN pip install --no-cache-dir --upgrade "setuptools>=78.1.1" \
+RUN pip install --no-cache-dir "setuptools==84.0.0" \
&& python -c "import re, pathlib; pins = re.findall(r'^([A-Za-z0-9._-]+==\S+)', pathlib.Path('requirements-ci.txt').read_text(), re.M); pathlib.Path('/tmp/constraints.txt').write_text('\n'.join(pins))" \
&& pip install --no-cache-dir -c /tmp/constraints.txt ".[explorer]" \
&& rm -f /tmp/constraints.txt requirements-ci.txt \