From 0a98f3549244ac22ded50ccf1966c3b03694536d Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 2 Dec 2026 10:43:32 +0000 Subject: [PATCH] fix(ci): pin GitHub actions by SHA, restrict token, add security policy Resolves the open OpenSSF Scorecard code-scanning alerts that a change in this repository can fix: - PinnedDependencies: every GitHub-owned action is pinned by commit SHA (actions/checkout v7.0.1, github/codeql-action init, analyze and upload-sarif v4.39.5); scorecard.yml carried checkout v7.0.0 under a wrong v4.2.2 comment. Dependabot keeps the pins current. - TokenPermissions: mark-stable, publish-containers and security-codeql get a top-level contents: read; every job there already declares its own permissions, so no job token changes. - SecurityPolicy: .github/SECURITY.md with private reporting via GitHub advisories. Left open on purpose: the job-level write permissions those jobs need, the Dockerfile FROM ${BASE_IMAGE} that scripts/build/base.sh resolves per distro, and the repository-setting checks. | Fix | Break | Tokens | Velocity | Security | Score | | --- | --- | --- | --- | --- | --- | | 93 % | 3 % | 100 % | 100 % | 100 % | 90 | Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 --- .github/SECURITY.md | 19 +++++++++++++++++++ .github/workflows/lint-docker.yml | 4 ++-- .github/workflows/lint-shell.yml | 2 +- .github/workflows/mark-stable.yml | 6 +++++- .github/workflows/publish-containers.yml | 9 ++++++--- .github/workflows/scorecard.yml | 4 ++-- .github/workflows/security-codeql.yml | 9 ++++++--- .github/workflows/test-e2e.yml | 2 +- .github/workflows/test-env-nix.yml | 2 +- .github/workflows/test-env-virtual.yml | 2 +- .github/workflows/test-integration.yml | 2 +- .github/workflows/test-unit.yml | 2 +- .github/workflows/test-virgin.yml | 2 +- .github/workflows/update-flake-lock.yml | 2 +- 14 files changed, 48 insertions(+), 19 deletions(-) create mode 100644 .github/SECURITY.md diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000..45b055d --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,19 @@ +# Security Policy + +## Supported Versions + +Only the latest release receives security fixes. Fixes land on `main` and ship +with the next release; the `stable` tag and the published container images +follow the highest released version. + +## Reporting a Vulnerability + +Please do not report security issues in a public issue or pull request. + +Report them privately through either channel: + +- GitHub: [report a vulnerability](https://github.com/kevinveenbirkenbach/package-manager/security/advisories/new) +- Email: Kevin Veen-Birkenbach, [kevin@veen.world](mailto:kevin@veen.world), [veen.world](https://veen.world) + +Include the affected version, the steps to reproduce, and the impact you +expect. diff --git a/.github/workflows/lint-docker.yml b/.github/workflows/lint-docker.yml index 3673f4d..b1b63ac 100644 --- a/.github/workflows/lint-docker.yml +++ b/.github/workflows/lint-docker.yml @@ -15,7 +15,7 @@ jobs: security-events: write steps: - name: Checkout code - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Run hadolint (produce SARIF) id: hadolint @@ -29,7 +29,7 @@ jobs: - name: Upload analysis results to GitHub if: always() - uses: github/codeql-action/upload-sarif@v4 + uses: github/codeql-action/upload-sarif@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5 with: sarif_file: hadolint-results.sarif wait-for-processing: true diff --git a/.github/workflows/lint-shell.yml b/.github/workflows/lint-shell.yml index 3fc7329..97aa3e9 100644 --- a/.github/workflows/lint-shell.yml +++ b/.github/workflows/lint-shell.yml @@ -10,7 +10,7 @@ jobs: lint-shell: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install ShellCheck run: sudo apt-get update && sudo apt-get install -y shellcheck - name: Run ShellCheck diff --git a/.github/workflows/mark-stable.yml b/.github/workflows/mark-stable.yml index 75b7c6b..40583da 100644 --- a/.github/workflows/mark-stable.yml +++ b/.github/workflows/mark-stable.yml @@ -8,6 +8,10 @@ on: push: tags: - 'v*' + +permissions: + contents: read + jobs: mark-stable: runs-on: ubuntu-latest @@ -19,7 +23,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 fetch-tags: true # We need tags and main history for version comparison diff --git a/.github/workflows/publish-containers.yml b/.github/workflows/publish-containers.yml index 2fd17e8..64e0d82 100644 --- a/.github/workflows/publish-containers.yml +++ b/.github/workflows/publish-containers.yml @@ -8,6 +8,9 @@ on: - cron: "0 3 * * *" workflow_dispatch: +permissions: + contents: read + jobs: prepare: if: ${{ github.event_name != 'workflow_run' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_repository.full_name == github.repository) }} @@ -21,7 +24,7 @@ jobs: steps: - name: Checkout repository (with tags) - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 @@ -54,7 +57,7 @@ jobs: steps: - name: Checkout ${{ matrix.release.version }} - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: ${{ matrix.release.sha }} @@ -96,7 +99,7 @@ jobs: steps: - name: Checkout ${{ matrix.release.version }} - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: ${{ matrix.release.sha }} diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 1a87006..21d404a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4.2.2 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -36,6 +36,6 @@ jobs: publish_results: true - name: Upload to code-scanning - uses: github/codeql-action/upload-sarif@v4 + uses: github/codeql-action/upload-sarif@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5 with: sarif_file: results.sarif diff --git a/.github/workflows/security-codeql.yml b/.github/workflows/security-codeql.yml index 437dbf1..ea22117 100644 --- a/.github/workflows/security-codeql.yml +++ b/.github/workflows/security-codeql.yml @@ -3,6 +3,9 @@ name: CodeQL Advanced on: workflow_call: +permissions: + contents: read + jobs: analyze: name: Check security @@ -23,10 +26,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Initialize CodeQL - uses: github/codeql-action/init@v4 + uses: github/codeql-action/init@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5 with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} @@ -42,6 +45,6 @@ jobs: exit 1 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v4 + uses: github/codeql-action/analyze@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5 with: category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 49f929e..ac15b03 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -19,7 +19,7 @@ jobs: access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Show Docker version run: docker version diff --git a/.github/workflows/test-env-nix.yml b/.github/workflows/test-env-nix.yml index cc9de39..43a1d4e 100644 --- a/.github/workflows/test-env-nix.yml +++ b/.github/workflows/test-env-nix.yml @@ -20,7 +20,7 @@ jobs: access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Show Docker version run: docker version diff --git a/.github/workflows/test-env-virtual.yml b/.github/workflows/test-env-virtual.yml index 6b61bb1..b09cb66 100644 --- a/.github/workflows/test-env-virtual.yml +++ b/.github/workflows/test-env-virtual.yml @@ -19,7 +19,7 @@ jobs: access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Show commit SHA run: git rev-parse HEAD diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 4955a54..abecfa4 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -15,7 +15,7 @@ jobs: access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Show Docker version run: docker version diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index 2b79ebc..ee1bdef 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -15,7 +15,7 @@ jobs: access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Show Docker version run: docker version diff --git a/.github/workflows/test-virgin.yml b/.github/workflows/test-virgin.yml index b238765..413830f 100644 --- a/.github/workflows/test-virgin.yml +++ b/.github/workflows/test-virgin.yml @@ -22,7 +22,7 @@ jobs: DISTRO: ${{ matrix.distro }} steps: - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Show Docker version run: docker version diff --git a/.github/workflows/update-flake-lock.yml b/.github/workflows/update-flake-lock.yml index cfeacd8..a7e1879 100644 --- a/.github/workflows/update-flake-lock.yml +++ b/.github/workflows/update-flake-lock.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install Nix uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23