From 208f3d4c7e56f2a916c6eb055f2c41bc4857618f Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar Date: Wed, 21 Oct 2026 16:00:21 +0000 Subject: [PATCH] fix(docker): Drop the compromised eMudhra root from the image (#90) Build stage upgrades Alpine ca-certificates(-bundle), fails if emSign ECC Root CA - G3 is still in the bundle and requires Go >= 1.26.10 (CVE-2026-111943); the distroless image gets that clean bundle. Co-Authored-By: Claude Opus 5.5 --- Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Dockerfile b/Dockerfile index bb856bb..db8e119 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,13 @@ # /erpmock — ERPNext stand-in for staging (decision 18; cmd/erpmock) FROM golang:1.26-alpine AS build +# eMudhra (Mozilla bug 2083449, Oct 2026): current ca-certificates, and fail +# the build if the bundle still holds "emSign ECC Root CA - G3" (the grep +# pattern is a line of that certificate). +RUN apk upgrade --no-cache ca-certificates-bundle ca-certificates \ + && ! grep -qF bm9sb2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0g /etc/ssl/certs/ca-certificates.crt +# Go >= 1.26.10 distrusts the eMudhra intermediates itself (CVE-2026-111943). +RUN case "$(go env GOVERSION)" in go1.26.[0-9]|go1.2[0-5].*) echo "$(go env GOVERSION) lacks the eMudhra distrust, need >= 1.26.10" >&2; exit 1;; esac WORKDIR /src COPY go.mod go.sum ./ RUN go mod download @@ -19,6 +26,8 @@ RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X git.breakpilot.com/plat CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /out/invoiceintake ./cmd/invoiceintake FROM gcr.io/distroless/static-debian12:nonroot +# The build stage's updated bundle: distroless ships one that still trusts emSign ECC Root CA - G3. +COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt WORKDIR / COPY --from=build /out/tenant-registry /tenant-registry COPY --from=build /out/migrate /migrate