From 962d6d91ba17100e3fe2a3d134ce963940902e09 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 13:15:08 +0000 Subject: [PATCH] Pin Docker base images by digest Clears the Pinned-Dependencies findings from OpenSSF Scorecard. Dependabot now checks the Docker images weekly, grouped, so pinned digests still get security fixes. --- .github/dependabot.yml | 4 +++- Dockerfile | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7e8d45f..86b42a2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -18,4 +18,6 @@ updates: # the base images in the Dockerfile - package-ecosystem: docker directory: / - schedule: { interval: monthly } + schedule: { interval: weekly } + groups: + docker: { patterns: ['*'] } diff --git a/Dockerfile b/Dockerfile index 09a0be1..27cb6e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,10 @@ # The build stages run on the build machine's own platform and cross-compile, # so images for ARM boards build as fast as the x86-64 one. +# Base images are pinned by digest; Dependabot moves the digests weekly. + # --- web app --- -FROM --platform=$BUILDPLATFORM node:22-alpine AS web +FROM --platform=$BUILDPLATFORM node:22-alpine@sha256:1314fb30ec37592d5845e5a160d522c0e680972aa534549940b8d73bde88481a AS web WORKDIR /web COPY web/package.json web/package-lock.json ./ RUN npm ci @@ -10,7 +12,7 @@ COPY web/ ./ RUN npm run build # --- backend --- -FROM --platform=$BUILDPLATFORM golang:1.27-alpine AS backend +FROM --platform=$BUILDPLATFORM golang:1.27-alpine@sha256:70bd7ddea8b6cbe5d6943cde279d6b67feb10cc924fb9100d1d8757c1575b280 AS backend ARG TARGETOS TARGETARCH TARGETVARIANT WORKDIR /src COPY backend/go.mod backend/go.sum ./ @@ -20,7 +22,7 @@ RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH GOARM=${TARGETVARIANT#v} \ go build -trimpath -ldflags="-s -w" -o /splitwiz . # --- runtime --- -FROM alpine:3.22 +FROM alpine:3.22@sha256:49340b346798875b5592e5d420241f2f9cfba5f47e62ebb1446a1b34734e898f RUN apk add --no-cache ca-certificates tzdata WORKDIR /app COPY --from=backend /splitwiz /app/splitwiz