Skip to content

fix(docker): upgrade the trust store in its own layer and fail the build if the emSign root survives - #16452

Merged
devGregA merged 2 commits into
DefectDojo:devfrom
devGregA:devgrega/trust-store-layer-guard
Oct 21, 2026
Merged

devGregA merged 2 commits into
DefectDojo:devfrom
devGregA:devgrega/trust-store-layer-guard

Conversation

@devGregA

Copy link
Copy Markdown
Contributor

What

Follow-up to #16449, whose squash merge only picked up the certifi pin. These two commits were pushed after the PR entered the merge queue.

  • Dockerfile.django-debian and Dockerfile.django-alpine get a separate ca-certificates upgrade layer after the existing package layers, keyed on ARG CA_REFRESH=2026-10-20.
  • A guard step after the pip install fails the build if emSign ECC Root CA - G3 is still in /etc/ssl/certs/ca-certificates.crt or in certifi's bundle.

Why

Eight eMudhra intermediate CAs had recoverable private keys (Mozilla bug 2083449).

The release workflow builds with cache-from: type=gha. The existing apt-get upgrade / apk upgrade layers have the same text and the same digest-pinned base as the last release, so buildx can reuse them and the fixed ca-certificates never installs. With only #16449 on dev, a rebuild fixes requests (certifi), but Python's default ssl context, requests pointed at the system bundle, and curl all still trust the test host.

  • CA_REFRESH makes the next forced refresh a one-line change.
  • The guard turns a stale trust store into a build failure instead of a silent ship.

Checked

  • The guard line exits 1 on the published defectdojo/defectdojo-django:latest, flagging both stores, and 0 after upgrading certifi to 2026.10.19 and ca-certificates to 20250419+deb13u1.
  • On python:3.14.8-alpine3.23, the guard exits 1 before and 0 after apk upgrade ca-certificates-bundle ca-certificates (20260909-r0 to 20261020-r0).
  • Full docker build --target release -f Dockerfile.django-debian: see the comment below once it finishes.

🤖 Generated with Claude Code

devGregA and others added 2 commits October 20, 2026 19:47
Release builds restore layers from the GitHub Actions cache, so the
apt-get upgrade / apk upgrade layer can be reused from an older build
and an OS trust-store fix never reaches the image. A separate upgrade
step after those layers picks up the eMudhra fix (Debian
20250419+deb13u1, Alpine ca-certificates-bundle 20261020-r0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…usted

The trust-store refresh layer can itself come from the build cache on a
later release. Add a CA_REFRESH build arg that the layer echoes, so
bumping it forces a rebuild, and a check after the pip install that
fails the build if emSign ECC Root CA - G3 is in the system bundle or
certifi.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devGregA

Copy link
Copy Markdown
Contributor Author

Full docker build --target release -f Dockerfile.django-debian on this branch succeeded. The guard step passed. Inside the built image: certifi 2026.10.19, and all four TLS paths reject https://dv-g3b-emudhra.we-have-a-problem.com/: requests (certifi), requests with the system bundle, stdlib urllib/ssl, and curl (verify=20).

@devGregA
devGregA added this pull request to the merge queue Oct 21, 2026
Merged via the queue into DefectDojo:dev with commit a4a5f37 Oct 21, 2026
47 checks passed
@devGregA
devGregA deleted the devgrega/trust-store-layer-guard branch October 21, 2026 02:35
@Maffooch Maffooch added this to the 3.4.201 milestone Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants