fix(docker): Drop the compromised eMudhra root from the image (#90)
ci / shared (push) Successful in 15s
ci / test (push) Successful in 26m25s
ci / image (push) Successful in 44s

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 <noreply@anthropic.com>
This commit was merged in pull request #90.
This commit is contained in:
sharangandClaude Opus 5.5 committed 2026-10-21 16:00:21 +00:00
1 parent ad4fe8f3fd
commit 208f3d4c7e
1 file changed
+9
+9
View File
@@ -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