From 0a26b8795aeba62cbf088aa3a3fba65f77f1a24e Mon Sep 17 00:00:00 2001 From: didericis Date: Thu, 16 Jul 2026 15:53:40 -0400 Subject: [PATCH] refactor(gateway): install gitleaks by pinned+verified download, drop third-party base image (PR #354 review) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gateway used `FROM zricethezav/gitleaks AS gitleaks-src` purely to COPY the binary out — a supply-chain surface (a whole third-party image as a build input, tying us to its cadence). Install gitleaks from its official release instead, pinned by version + SHA256 and verified. python (already in the image) does the download, so no curl/wget is added. trixie apt also ships gitleaks but an older 8.16; the pinned download keeps the verified 8.30.1 (byte-identical to what the image provided). Verified: gateway + infra images build, gitleaks 8.30.1 runs in both. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01WBMWTEtQdJ4W5UrWuLHCck --- Dockerfile.gateway | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/Dockerfile.gateway b/Dockerfile.gateway index 4b3ec9b..29448fa 100644 --- a/Dockerfile.gateway +++ b/Dockerfile.gateway @@ -34,18 +34,13 @@ # 9420 git-gate smart HTTP (VM-backend agent-facing transport) # 9100 supervise (MCP HTTP) -# Stage 1: gitleaks binary. The upstream gitleaks image is alpine -# with the binary at /usr/bin/gitleaks. Pinned by digest in lockstep -# with Dockerfile.git-gate's prior base (now deleted at chunk 3). -FROM zricethezav/gitleaks@sha256:c00b6bd0aeb3071cbcb79009cb16a60dd9e0a7c60e2be9ab65d25e6bc8abbb7f AS gitleaks-src - -# Stage 2: assembly. Based on `python:3.12-slim` (Debian trixie) rather -# than the `mitmproxy/mitmproxy` image (Debian bookworm) so the whole -# stack — gateway here, and the firecracker infra image that builds -# FROM this — lands on trixie, whose buildah (1.39) can build agent -# Dockerfiles that use heredocs. mitmproxy is pip-installed to the same -# effect as the upstream image. (bookworm's buildah is 1.28, which can't -# parse `RUN ... <