diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index a8a904ac..7b84a1f5 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -32,23 +32,25 @@ jobs: security-events: write id-token: write steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - - uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.3 — floating v2 tag no longer resolves upstream; pinned to commit per Scorecard's own pinned-deps recommendation + # The floating v2 tag no longer resolves upstream, so this is pinned to a + # commit, per Scorecard's own pinned-deps recommendation. + - uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4 with: results_file: results.sarif results_format: sarif publish_results: true - - uses: actions/upload-artifact@v7 + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: scorecard-sarif path: results.sarif retention-days: 30 - - uses: github/codeql-action/upload-sarif@v4 + - uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1 with: sarif_file: results.sarif @@ -56,9 +58,9 @@ jobs: name: SBOM (syft) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: anchore/sbom-action@v0 + - uses: anchore/sbom-action@66cbf4bc1f1c0d2edc94016e65bc221b6bb0ad6c # v0.24.3 with: path: . format: cyclonedx-json @@ -69,15 +71,15 @@ jobs: name: Deterministic claims guard runs-on: ubuntu-latest steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 # gitleaks needs full history - - uses: pnpm/action-setup@v6 + - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: version: 10.32.1 - - uses: actions/setup-node@v7 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 22 cache: pnpm @@ -91,7 +93,7 @@ jobs: working-directory: frontend run: pnpm build - - uses: actions/setup-go@v7 + - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: go.mod cache: true @@ -110,14 +112,20 @@ jobs: exit 1 fi + # The three scanners below are installed at fixed versions rather than + # @latest, so a run is reproducible and a new release cannot change the + # gate unannounced. Dependabot does not see `go install` lines, so these + # are bumped by hand. govulncheck reads the live vulnerability database + # on every run whatever its own version, so pinning it does not freeze + # what it knows about. - name: govulncheck (clean-security-scan claim) run: | - go install golang.org/x/vuln/cmd/govulncheck@latest + go install golang.org/x/vuln/cmd/govulncheck@v1.9.0 govulncheck ./... - name: gosec (clean-security-scan claim — AUDIT.md says every finding is annotated) run: | - go install github.com/securego/gosec/v2/cmd/gosec@latest + go install github.com/securego/gosec/v2/cmd/gosec@v2.30.0 gosec ./... - name: gitleaks (clean-security-scan claim) @@ -127,5 +135,5 @@ jobs: # same way govulncheck/gosec above do, and the same invocation AUDIT.md # documents for a local run. run: | - go install github.com/zricethezav/gitleaks/v8@latest + go install github.com/zricethezav/gitleaks/v8@v8.30.1 gitleaks detect --source . --no-banner -v diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bff0bce..9dece472 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: steps: # Full history, because the CLA check below needs the fork point of the pull # request, not just the tip of the base branch. The repository is small. - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 @@ -70,11 +70,11 @@ jobs: print(f"CLA ledger append-only: {len(base_by_id)} signed at base, {len(head_ids)} now, none removed") PY - - uses: pnpm/action-setup@v6 + - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 with: version: 10.32.1 - - uses: actions/setup-node@v7 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 22 cache: pnpm @@ -112,7 +112,7 @@ jobs: working-directory: frontend run: pnpm test:visual - - uses: actions/setup-go@v7 + - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version-file: go.mod cache: true diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index 97d99466..10df2f86 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -32,7 +32,7 @@ jobs: steps: - name: CLA Assistant if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' - uses: contributor-assistant/github-action@v2.6.1 + uses: contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # v2.6.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 52beaf75..40d558b9 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -58,15 +58,15 @@ jobs: contents: read packages: write steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: docker/setup-qemu-action@v4 + - uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0 - - uses: docker/setup-buildx-action@v4 + - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 - name: Log in to GHCR if: github.event_name == 'push' - uses: docker/login-action@v4 + uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -81,7 +81,7 @@ jobs: # pre-release deploy can be pinned to an immutable tag that names its commit. - name: Docker metadata id: meta - uses: docker/metadata-action@v6 + uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | @@ -93,7 +93,7 @@ jobs: - name: Build (push on branch pushes and on tags) id: build - uses: docker/build-push-action@v7 + uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 with: context: . platforms: ${{ env.BUILD_PLATFORMS }} @@ -105,7 +105,7 @@ jobs: COMMIT=${{ github.sha }} - name: Export standalone binaries - uses: docker/build-push-action@v7 + uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 with: context: . target: standalone @@ -138,7 +138,7 @@ jobs: # workflow_dispatch dry run, or the rehearsal finds no artifact to download. - name: Upload standalone binaries if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && inputs.dry_run) - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: standalone-binaries path: dist/release/ @@ -164,7 +164,7 @@ jobs: contents: read packages: read steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Prove this runner is genuinely arm64 run: | @@ -246,9 +246,11 @@ jobs: # Regression guard for the quick-start trap: a first start with no # CALNODE_ENCRYPTION_KEY must write a key beside the database, so stored # credentials survive a restart instead of becoming unreadable. + # The helper image is pinned by digest (the multi-arch alpine:3 index). + # Dependabot does not read `docker run` lines, so bump it by hand. run: | set -euo pipefail - docker run --rm -v calnode-data:/data alpine:3 sh -c 'test -s /data/calnode.key' \ + docker run --rm -v calnode-data:/data alpine:3@sha256:be2656061b536c1883c4034790e21d0a09c5aaaf51968b89368a3c0371ea2c9a sh -c 'test -s /data/calnode.key' \ && echo "key persisted beside the database" - name: Assert a restart still finds the key @@ -294,9 +296,9 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: actions/download-artifact@v8 + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: name: standalone-binaries path: dist/release diff --git a/.github/workflows/ns8-module.yml b/.github/workflows/ns8-module.yml index 7879ae16..17c2d5e9 100644 --- a/.github/workflows/ns8-module.yml +++ b/.github/workflows/ns8-module.yml @@ -42,7 +42,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Validate action scripts and schemas working-directory: packaging/ns8 @@ -184,19 +184,19 @@ jobs: contents: read packages: write steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 # Required to build the arm64 variant of the module image on an amd64 # runner. Without it the module image would be amd64-only and podman # could not run it on an arm64 NS8 node. - - uses: docker/setup-qemu-action@v4 + - uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0 with: platforms: all # The UI build is the slow part; cache the dependency tree the way the # upstream NS8 publish workflow does, so branch and PR runs do not # re-download the whole Vue/Carbon tree every time. - - uses: actions/cache@v6 + - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: packaging/ns8/ui/node_modules key: "yarn-${{ hashFiles('packaging/ns8/ui/yarn.lock') }}" @@ -226,7 +226,7 @@ jobs: - name: Log in to GHCR if: github.event_name != 'pull_request' - uses: docker/login-action@v3 + uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0 with: registry: ghcr.io username: ${{ github.actor }} diff --git a/.github/workflows/pullfrog.yml b/.github/workflows/pullfrog.yml index e175a251..852408a5 100644 --- a/.github/workflows/pullfrog.yml +++ b/.github/workflows/pullfrog.yml @@ -22,11 +22,11 @@ jobs: contents: read steps: - name: Checkout code - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 1 - name: Run agent - uses: pullfrog/pullfrog@v0 + uses: pullfrog/pullfrog@8302038bc7ab13f579cfef4bad72941b87f8c1c5 # v0.1.107 with: prompt: ${{ inputs.prompt }} model: opencode-go/deepseek-v4.1-flash diff --git a/.github/workflows/release-verify.yml b/.github/workflows/release-verify.yml index 4ec35c37..d1e145ad 100644 --- a/.github/workflows/release-verify.yml +++ b/.github/workflows/release-verify.yml @@ -40,7 +40,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 # Live evidence that the sibling lookup actually works against the real API. # This runs unconditionally and does not depend on the gate's decision, diff --git a/.github/workflows/test-module.yml b/.github/workflows/test-module.yml index a05cd5bf..bdd4c5d7 100644 --- a/.github/workflows/test-module.yml +++ b/.github/workflows/test-module.yml @@ -67,7 +67,12 @@ jobs: contents: read pull-requests: write statuses: write - uses: NethServer/ns8-github-actions/.github/workflows/test-on-digitalocean-infra.yml@v1 + # Pinned to a commit on NethServer's `v1` branch (a branch, not a tag). + # It is the last commit that still has this workflow: the branch has since + # removed test-on-digitalocean-infra.yml in favour of test-module-qemu.yml, + # so `@v1` no longer resolves to it. Moving this pin to the branch head + # would break the workflow, so check that the file exists before bumping. + uses: NethServer/ns8-github-actions/.github/workflows/test-on-digitalocean-infra.yml@3dc3a490752846c4cb0ea86921f8ae3790d7d78c with: # packaging/ns8 holds both the module definition and tests/, so this is the # module root for the purposes of the runner. diff --git a/Dockerfile b/Dockerfile index af6f0f6a..14875536 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,15 @@ # syntax=docker/dockerfile:1 +# Base images are pinned by digest (the multi-arch index, so every platform +# resolves). The tag stays beside it for readers and for Dependabot, whose +# docker entry bumps the digest when the tag moves. + # ── Frontend build stage ─────────────────────────────────────────────────────── # Built for the BUILD platform, not the target: the output is static JS/CSS that is # identical for every architecture. Without this pin a multi-arch build (buildx: # linux/amd64,linux/arm64) runs pnpm install and pnpm build a second time under QEMU # for arm64, which is slow and occasionally hangs for hours. -FROM --platform=$BUILDPLATFORM node:22-alpine AS frontend-builder +FROM --platform=$BUILDPLATFORM node:22-alpine@sha256:fe4f6d74e20370acb04ad889077d14d0f64a9c8ea6a42bc60cddf1e844699914 AS frontend-builder # Pin pnpm to the version in package.json's `packageManager` field (not @latest) # so CI builds are reproducible and match the committed lockfile. @@ -24,7 +28,7 @@ RUN pnpm build # target arch; there is no reason for this stage to run under QEMU. Running it # emulated is what made a multi-arch build stall: the arm64 leg spent its time # interpreting the compiler instead of compiling. -FROM --platform=$BUILDPLATFORM golang:1.27.3-alpine AS builder +FROM --platform=$BUILDPLATFORM golang:1.27.3-alpine@sha256:d200d2dd76b03a99b52651fd1325aff7dcd35422c35c01bac56571b0507f3deb AS builder RUN apk add --no-cache ca-certificates wget @@ -71,7 +75,7 @@ COPY LICENSE /LICENSE # No --platform pin: under buildx this defaults to the TARGET platform, which is # what we want (an arm64 final image for arm64 consumers). Only the two builder # stages above are pinned to BUILDPLATFORM. -FROM alpine:3.24 +FROM alpine:3.24@sha256:be2656061b536c1883c4034790e21d0a09c5aaaf51968b89368a3c0371ea2c9a RUN apk add --no-cache ca-certificates tzdata