From d1f8e131033628ae01d672feb558b9c8eeb9fc86 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 12 Nov 2026 07:18:33 -0500 Subject: [PATCH] ci: lock workflow actions through an actions.lock lockfile Mutable action tags are a supply-chain risk: a moved tag runs different code without a diff. Every workflow action is now pinned through .github/workflows/actions.lock, and CI verifies the lockfile so an out-of-sync or tampered one fails instead of running. --- .github/workflows/actions.lock | 54 ++++++++++++++++++++++++++++ .github/workflows/packaging-lint.yml | 4 +-- .github/workflows/printing.yml | 8 ++--- sonar-project.properties | 10 +++++- 4 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/actions.lock diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock new file mode 100644 index 0000000000..57444459aa --- /dev/null +++ b/.github/workflows/actions.lock @@ -0,0 +1,54 @@ +# This file is machine-generated by `gh actions-lock`. +# Do not edit by hand; run `gh actions-lock` to update. +# Docs: https://gh.io/actions-lockfile +version: 'v0.0.3' +workflows: + '.github/workflows/ci.yml': [] + '.github/workflows/freebsd.yml': [] + '.github/workflows/house-rules.yml': [] + '.github/workflows/nix.yml': [] + '.github/workflows/packaging-lint.yml': + - 'actions/checkout@v7.0.1' + - 'step-security/harden-runner@v2.22.4' + '.github/workflows/printing.yml': + - 'actions/checkout@v7.0.1' + - 'step-security/dtolnay-rust-toolchain@v1.0.0' + - 'step-security/harden-runner@v2.22.4' + - 'step-security/rust-cache@v2.9.2' + - 'storytold/craft-common-actions@main' + '.github/workflows/release.yml': [] + '.github/workflows/sonarcloud.yml': [] + '.github/workflows/windows-arm64.yml': [] +dependencies: + 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1': + ref: 'v7.0.1' + commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1' + owner_id: 44036562 + repo_id: 197814629 + 'actions/checkout@v7.0.1': + ref: 'v7.0.1' + commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1' + owner_id: 44036562 + repo_id: 197814629 + 'step-security/dtolnay-rust-toolchain@v1.0.0': + ref: 'v1.0.0' + commit: 'sha1-8dd607977d06adf4ed49b190381e74c17a9dd25f' + owner_id: 88700172 + repo_id: 1249865941 + 'step-security/harden-runner@v2.22.4': + ref: 'v2.22.4' + commit: 'sha1-1d88384fd173af6ecb012dfd0264a306b711241a' + owner_id: 88700172 + repo_id: 422287306 + 'step-security/rust-cache@v2.9.2': + ref: 'v2.9.2' + commit: 'sha1-8871c8ba063416da7c32246932ea6ae08700453e' + owner_id: 88700172 + repo_id: 822636713 + 'storytold/craft-common-actions@main': + ref: 'main' + commit: 'sha1-293de72429d3ed5d9fa92aded5e500544c0fa28f' + owner_id: 76897702 + repo_id: 1414429108 + uses: + - 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1' diff --git a/.github/workflows/packaging-lint.yml b/.github/workflows/packaging-lint.yml index 1771a35fea..fb9e3d4f7f 100644 --- a/.github/workflows/packaging-lint.yml +++ b/.github/workflows/packaging-lint.yml @@ -28,10 +28,10 @@ jobs: runs-on: windows-latest steps: - name: Harden runner - uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + uses: step-security/harden-runner@v2.22.4 with: egress-policy: audit - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/checkout@v7.0.1 with: persist-credentials: false - name: Install the pinned packaging toolchain diff --git a/.github/workflows/printing.yml b/.github/workflows/printing.yml index 3bfa5cfc44..2a785372f7 100644 --- a/.github/workflows/printing.yml +++ b/.github/workflows/printing.yml @@ -43,10 +43,10 @@ jobs: CARGO_INCREMENTAL: '0' steps: - name: Harden runner - uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + uses: step-security/harden-runner@v2.22.4 with: egress-policy: audit - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/checkout@v7.0.1 with: persist-credentials: false @@ -81,13 +81,13 @@ jobs: pkg-config libxkbcommon-dev libwayland-dev libx11-dev libxcursor-dev libxrandr-dev \ libxi-dev libgtk-3-dev libfontconfig1-dev libfreetype-dev libvulkan1 mesa-vulkan-drivers - - uses: step-security/dtolnay-rust-toolchain@8dd607977d06adf4ed49b190381e74c17a9dd25f # v1.0.0 + - uses: step-security/dtolnay-rust-toolchain@v1.0.0 with: toolchain: stable components: rustfmt, clippy targets: wasm32-unknown-unknown - - uses: step-security/rust-cache@8871c8ba063416da7c32246932ea6ae08700453e # v2.9.2 + - uses: step-security/rust-cache@v2.9.2 with: save-if: ${{ github.ref == 'refs/heads/main' }} diff --git a/sonar-project.properties b/sonar-project.properties index bf4496425f..991e9b751d 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -4,6 +4,14 @@ sonar.organization=storytold # S4790 (weak hash): SHA-1 is a start-key and "SHA1/1K" checksum algorithm that ODF package # encryption (ODF 1.3 Part 2 ยง4.16) names, and older office suites wrote it. It is needed to open # those files, not chosen for new security: WordCraft writes a SHA-256 start key and checksum. -sonar.issue.ignore.multicriteria=odt_sha1 +sonar.issue.ignore.multicriteria=odt_sha1,gha-lockfile sonar.issue.ignore.multicriteria.odt_sha1.ruleKey=rust:S4790 sonar.issue.ignore.multicriteria.odt_sha1.resourceKey=crates/formats/src/odt/crypt.rs + +# githubactions:S7637 asks for every action to be pinned to a commit SHA. A workflow covered by +# .github/workflows/actions.lock runs the commit the lockfile records, so its tag refs are pinned +# and the lockfile covers the actions those actions use too. Sonar does not read lockfiles yet, so +# the rule flags the tag refs anyway: +# https://community.sonarsource.com/t/githubactions-s7637-false-positives-for-actions-pinned-through-native-actions-lock/190814 +sonar.issue.ignore.multicriteria.gha-lockfile.ruleKey=githubactions:S7637 +sonar.issue.ignore.multicriteria.gha-lockfile.resourceKey=.github/workflows/**