fix(docker): Drop the compromised eMudhra root from the image #90

Merged
sharang merged 1 commits from fix/emudhra-ca-store into main 2026-10-21 16:00:21 +00:00
+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