From 28a99f974dbaf200b8b46c8b091f931d7aa4786a Mon Sep 17 00:00:00 2001 From: Natalia Miakushina Date: Fri, 23 Oct 2026 09:46:05 +0200 Subject: [PATCH 1/2] fix: update CA certificates in runtime image Signed-off-by: Natalia Miakushina --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d03caa6..37d103c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM alpine:3.21.2 -RUN apk add --no-cache ca-certificates gpgme tini && update-ca-certificates +RUN apk add --no-cache ca-certificates gpgme tini && \ + apk add --no-cache --upgrade ca-certificates && \ + update-ca-certificates COPY docker-sync / COPY entrypoint.sh / From 01df3f175ca775ef78e1c7b3a0d67f51d645f7d5 Mon Sep 17 00:00:00 2001 From: Natalia Miakushina Date: Fri, 23 Oct 2026 09:46:47 +0200 Subject: [PATCH 2/2] ci: verify image rejects compromised CA chains Signed-off-by: Natalia Miakushina --- .github/workflows/check-compromised-ca.yml | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/check-compromised-ca.yml diff --git a/.github/workflows/check-compromised-ca.yml b/.github/workflows/check-compromised-ca.yml new file mode 100644 index 0000000..1e5864d --- /dev/null +++ b/.github/workflows/check-compromised-ca.yml @@ -0,0 +1,54 @@ +name: Check compromised CA trust + +on: + push: + branches: [main] + paths: + - Dockerfile + - .github/workflows/check-compromised-ca.yml + workflow_dispatch: + +permissions: + contents: read + +jobs: + check-compromised-ca: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + # The final Dockerfile copies this pre-built binary. Keep the flags + # aligned with .goreleaser.yaml. + - name: Build docker-sync binary + run: >- + CGO_ENABLED=0 go build -trimpath + -tags 'containers_image_docker_daemon_stub containers_image_openpgp containers_image_storage_stub' + -o docker-sync ./cmd/docker-sync + + - name: Build final runtime image + run: docker build --tag local/docker-sync:ca-check . + + - name: Verify compromised CA chains are rejected + shell: bash + run: | + set -euo pipefail + endpoints=( + 'https://dv-g3b-emudhra.we-have-a-problem.com/' + 'https://dv-g3b-aaa-emudhra.we-have-a-problem.com/' + ) + + for endpoint in "${endpoints[@]}"; do + echo "Verifying that ${endpoint} is rejected" + if docker run --rm --entrypoint /bin/sh local/docker-sync:ca-check \ + -c "wget -O /dev/null '${endpoint}'"; then + echo "ERROR: the final image still trusts a compromised CA chain: ${endpoint}" >&2 + exit 1 + fi + done + +