From 83e81167c66ab9b69e3c7293a8cd3c800d1f57a5 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 10 Nov 2026 07:18:57 -0500 Subject: [PATCH 01/11] ci: add StepSecurity Harden-Runner to every workflow job Adds step-security/harden-runner (v2.22.4, SHA-pinned) as the first step of every job in the reusable and repo workflows, in egress-policy: audit mode. Audit mode only records network, file and process activity; it blocks nothing. Unsupported environments (containers, FreeBSD VM guests, ubuntu-slim) are skipped by the action itself. Dependabot's github-actions group keeps the pin current. --- .github/workflows/ast-grep.yml | 4 ++ .github/workflows/changed-paths.yml | 4 ++ .github/workflows/docker-build.yml | 8 ++++ .github/workflows/flatpak-oci.yml | 4 ++ .github/workflows/freebsd.yml | 4 ++ .github/workflows/gate.yml | 4 ++ .github/workflows/git-sources.yml | 4 ++ .github/workflows/house-rules.yml | 4 ++ .github/workflows/nix.yml | 4 ++ .github/workflows/packaging-lint.yml | 4 ++ .github/workflows/refresh-contributors.yml | 4 ++ .github/workflows/release.yml | 48 +++++++++++++++++++ .github/workflows/sonarcloud.yml | 16 +++++++ .github/workflows/supply-chain.yml | 4 ++ .github/workflows/test-ast-grep.yml | 4 ++ .github/workflows/test-freebsd.yml | 4 ++ .github/workflows/test-house-rules.yml | 4 ++ .../workflows/test-install-apt-packages.yml | 4 ++ .github/workflows/windows-arm64.yml | 8 ++++ 19 files changed, 140 insertions(+) diff --git a/.github/workflows/ast-grep.yml b/.github/workflows/ast-grep.yml index 056687e..4f198c1 100644 --- a/.github/workflows/ast-grep.yml +++ b/.github/workflows/ast-grep.yml @@ -35,6 +35,10 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/changed-paths.yml b/.github/workflows/changed-paths.yml index 605d6dd..777e636 100644 --- a/.github/workflows/changed-paths.yml +++ b/.github/workflows/changed-paths.yml @@ -45,6 +45,10 @@ jobs: matched: ${{ steps.match.outputs.matched }} reason: ${{ steps.match.outputs.reason }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit # Two commits deep for the merge commit's first parent; trees only, no file contents. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 194b1da..77ad337 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -107,6 +107,10 @@ jobs: runs-on: ${{ matrix.platform.runner }} timeout-minutes: ${{ inputs.timeout-minutes }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - name: Check out uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -246,6 +250,10 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 15 steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - name: Download digests uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: diff --git a/.github/workflows/flatpak-oci.yml b/.github/workflows/flatpak-oci.yml index 05e72e9..1bd8a16 100644 --- a/.github/workflows/flatpak-oci.yml +++ b/.github/workflows/flatpak-oci.yml @@ -34,6 +34,10 @@ jobs: - { arch: x86_64, runner: ubuntu-24.04 } - { arch: aarch64, runner: ubuntu-24.04-arm } steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index 3cf787e..9840cbb 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -71,6 +71,10 @@ jobs: CARGO_INCREMENTAL: 0 CARGO_BUILD_JOBS: 4 steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Check out craft-fonts if: inputs.craft-fonts-ref != '' diff --git a/.github/workflows/gate.yml b/.github/workflows/gate.yml index 8f508b8..eded0bd 100644 --- a/.github/workflows/gate.yml +++ b/.github/workflows/gate.yml @@ -118,6 +118,10 @@ jobs: CARGO_NET_RETRY: 10 RUST_BACKTRACE: 1 steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/git-sources.yml b/.github/workflows/git-sources.yml index 4b43ad9..1a51ee8 100644 --- a/.github/workflows/git-sources.yml +++ b/.github/workflows/git-sources.yml @@ -27,6 +27,10 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 5 steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/house-rules.yml b/.github/workflows/house-rules.yml index 667f275..1baca5a 100644 --- a/.github/workflows/house-rules.yml +++ b/.github/workflows/house-rules.yml @@ -30,6 +30,10 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 83a54c6..92d219a 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -18,6 +18,10 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23 - name: Check flake evaluation diff --git a/.github/workflows/packaging-lint.yml b/.github/workflows/packaging-lint.yml index e12e606..95a0c79 100644 --- a/.github/workflows/packaging-lint.yml +++ b/.github/workflows/packaging-lint.yml @@ -19,6 +19,10 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Run packaging lint uses: storytold/craft-common-actions/actions/packaging-lint@main diff --git a/.github/workflows/refresh-contributors.yml b/.github/workflows/refresh-contributors.yml index 08e3752..8a92483 100644 --- a/.github/workflows/refresh-contributors.yml +++ b/.github/workflows/refresh-contributors.yml @@ -18,6 +18,10 @@ jobs: outputs: artifact-name: contributor-snapshot-${{ github.run_id }}-${{ github.run_attempt }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3c4266d..fcaf633 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -148,6 +148,10 @@ jobs: permissions: contents: read steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Git dependencies come from storytold run: | @@ -191,6 +195,10 @@ jobs: date: ${{ steps.v.outputs.date }} prerelease: ${{ steps.v.outputs.prerelease }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - id: v name: Resolve version @@ -214,6 +222,10 @@ jobs: BUILD_SHA: ${{ github.sha }} INPUT_VERSION: ${{ inputs.version }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit # A signed job reads only the secrets the caller lists in its `secrets:` block; values come # from the repo's `release` environment. An unlisted name is empty, and the app's packaging # would then warn and ship unsigned, so on the release branch fail here instead. @@ -334,6 +346,10 @@ jobs: BUILD_SHA: ${{ github.sha }} INPUT_VERSION: ${{ inputs.version }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit # See the macOS job: unlisted secrets are empty, and the build would ship unsigned. # Signing needs either the PFX pair or all six Azure Trusted Signing values. - name: Require signing secrets on the release branch @@ -439,6 +455,10 @@ jobs: BUILD_SHA: ${{ github.sha }} INPUT_VERSION: ${{ inputs.version }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Load refreshed contributor credits if: inputs.contributors-artifact != '' @@ -532,6 +552,10 @@ jobs: BUILD_DATE: ${{ needs.version.outputs.date }} BUILD_SHA: ${{ github.sha }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Export the app's build variables id: app-env @@ -649,6 +673,10 @@ jobs: matrix: arch: [x86_64, aarch64] steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: @@ -708,6 +736,10 @@ jobs: BUILD_SHA: ${{ github.sha }} INPUT_VERSION: ${{ inputs.version }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - name: Check the FreeBSD architecture env: ARCH: ${{ matrix.arch }} @@ -937,6 +969,10 @@ jobs: BUILD_SHA: ${{ github.sha }} INPUT_VERSION: ${{ inputs.version }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Load refreshed contributor credits if: inputs.contributors-artifact != '' @@ -1009,6 +1045,10 @@ jobs: BUILD_SHA: ${{ github.sha }} INPUT_VERSION: ${{ inputs.version }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Load refreshed contributor credits if: inputs.contributors-artifact != '' @@ -1103,6 +1143,10 @@ jobs: BUILD_DATE: ${{ needs.version.outputs.date }} BUILD_SHA: ${{ github.sha }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Load refreshed contributor credits if: inputs.contributors-artifact != '' @@ -1154,6 +1198,10 @@ jobs: permissions: contents: write steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: storytold/craft-common-actions/actions/draft-release@main with: version: ${{ needs.version.outputs.version }} diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index b7efd43..d2cf617 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -66,6 +66,10 @@ jobs: outputs: matrix: ${{ steps.matrix.outputs.matrix }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -97,6 +101,10 @@ jobs: runs-on: ubuntu-latest timeout-minutes: ${{ inputs.timeout-minutes }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -168,6 +176,10 @@ jobs: fail-fast: false matrix: ${{ fromJSON(needs.plan.outputs.matrix) }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -239,6 +251,10 @@ jobs: runs-on: ubuntu-latest timeout-minutes: ${{ inputs.timeout-minutes }} steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 diff --git a/.github/workflows/supply-chain.yml b/.github/workflows/supply-chain.yml index 47b168c..5e1f1f9 100644 --- a/.github/workflows/supply-chain.yml +++ b/.github/workflows/supply-chain.yml @@ -22,6 +22,10 @@ jobs: attestations: write artifact-metadata: write steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - name: Download release artifacts uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: diff --git a/.github/workflows/test-ast-grep.yml b/.github/workflows/test-ast-grep.yml index 51be8f0..f98b40b 100644 --- a/.github/workflows/test-ast-grep.yml +++ b/.github/workflows/test-ast-grep.yml @@ -22,6 +22,10 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/test-freebsd.yml b/.github/workflows/test-freebsd.yml index bb3ae05..c01cd78 100644 --- a/.github/workflows/test-freebsd.yml +++ b/.github/workflows/test-freebsd.yml @@ -23,6 +23,10 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install YAML parser run: sudo apt-get update && sudo apt-get install -y --no-install-recommends python3-yaml tcsh rpm debsigs dpkg-dev skopeo diff --git a/.github/workflows/test-house-rules.yml b/.github/workflows/test-house-rules.yml index 5346617..d7f8254 100644 --- a/.github/workflows/test-house-rules.yml +++ b/.github/workflows/test-house-rules.yml @@ -24,6 +24,10 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/test-install-apt-packages.yml b/.github/workflows/test-install-apt-packages.yml index ccf63b1..fcef95a 100644 --- a/.github/workflows/test-install-apt-packages.yml +++ b/.github/workflows/test-install-apt-packages.yml @@ -20,6 +20,10 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 15 steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install packages uses: ./actions/install-apt-packages diff --git a/.github/workflows/windows-arm64.yml b/.github/workflows/windows-arm64.yml index 4fadd6e..bc64022 100644 --- a/.github/workflows/windows-arm64.yml +++ b/.github/workflows/windows-arm64.yml @@ -55,6 +55,10 @@ jobs: runs-on: windows-latest timeout-minutes: 90 steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Check out craft-i18n uses: storytold/craft-common-actions/actions/checkout-craft-i18n@main @@ -91,6 +95,10 @@ jobs: runs-on: windows-11-arm timeout-minutes: 30 steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: name: ${{ inputs.app-name }}-windows-arm64 From 529d68aa052fb40429c65372cad0689ddcffe121 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 10 Nov 2026 07:23:39 -0500 Subject: [PATCH 02/11] test: account for Harden-Runner step in workflow assertions Update unit test step inspections and unpacks to locate steps by name/action or ignore the leading Harden-Runner security step. --- tests/test_changed_paths.py | 2 +- tests/test_check_git_sources.py | 3 ++- tests/test_contributor_refresh.py | 4 ++-- tests/test_freebsd.py | 2 +- tests/test_house_rules.py | 3 ++- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/test_changed_paths.py b/tests/test_changed_paths.py index d6b8094..3db20b8 100644 --- a/tests/test_changed_paths.py +++ b/tests/test_changed_paths.py @@ -62,7 +62,7 @@ class ChangedPathsTests(unittest.TestCase): self.assertNotIn('${{', MATCH['run']) def test_checkout_is_pinned_and_keeps_no_credentials(self): - checkout = STEPS[0] + checkout = next(s for s in STEPS if s.get('uses', '').startswith('actions/checkout@')) self.assertRegex(checkout['uses'], r'^actions/checkout@[0-9a-f]{40}$') self.assertEqual(checkout['with']['persist-credentials'], 'false') self.assertEqual(checkout['with']['fetch-depth'], '2') diff --git a/tests/test_check_git_sources.py b/tests/test_check_git_sources.py index 83189a7..5f69eb5 100644 --- a/tests/test_check_git_sources.py +++ b/tests/test_check_git_sources.py @@ -167,7 +167,8 @@ class CheckGitSourcesWiringTests(unittest.TestCase): job = WORKFLOW["jobs"]["git-sources"] self.assertEqual(WORKFLOW["permissions"], {"contents": "read"}) self.assertIn("timeout-minutes", job) - checkout, check = job["steps"] + steps = [s for s in job["steps"] if s.get("name") != "Harden runner"] + checkout, check = steps self.assertTrue(checkout["uses"].startswith("actions/checkout@")) self.assertEqual(checkout["with"]["persist-credentials"], "false") self.assertEqual(check["uses"], "storytold/craft-common-actions/actions/check-git-sources@main") diff --git a/tests/test_contributor_refresh.py b/tests/test_contributor_refresh.py index 870dbed..7845179 100644 --- a/tests/test_contributor_refresh.py +++ b/tests/test_contributor_refresh.py @@ -81,7 +81,7 @@ Path('contributors/contributors.json').write_text(json.dumps(credits)) """Keep refresh read-only and publish the validated file under its output name.""" workflow = load('refresh-contributors.yml') self.assertEqual(workflow['permissions'], {'contents': 'read', 'pull-requests': 'read'}) - steps = workflow['jobs']['refresh']['steps'] + steps = [s for s in workflow['jobs']['refresh']['steps'] if s.get('name') != 'Harden runner'] checkout = steps[0] self.assertEqual(checkout['with']['fetch-depth'], '0') self.assertEqual(checkout['with']['persist-credentials'], 'false') @@ -97,7 +97,7 @@ Path('contributors/contributors.json').write_text(json.dumps(credits)) def test_generator_is_shared_and_paired_with_the_workflow_revision(self): """Pinned and forked workflows select their own generator, with literal path arguments.""" - steps = load('refresh-contributors.yml')['jobs']['refresh']['steps'] + steps = [s for s in load('refresh-contributors.yml')['jobs']['refresh']['steps'] if s.get('name') != 'Harden runner'] self.assertEqual(steps[1]['uses'], '$/actions/refresh-contributors') action = shared_action()['runs']['steps'][0] self.assertEqual(action['env']['GENERATOR_PATH'], '${{ github.action_path }}/refresh_contributors.py') diff --git a/tests/test_freebsd.py b/tests/test_freebsd.py index 44b04ee..980df65 100644 --- a/tests/test_freebsd.py +++ b/tests/test_freebsd.py @@ -389,7 +389,7 @@ fi def test_release_workflow_rejects_unsupported_architectures_before_the_vm(self): release = yaml.load((ROOT / ".github/workflows/release.yml").read_text(), Loader=yaml.BaseLoader) steps = release["jobs"]["freebsd"]["steps"] - check = steps[0] + check = next(step for step in steps if step.get("name") == "Check the FreeBSD architecture") self.assertEqual(check["name"], "Check the FreeBSD architecture") self.assertEqual(check["env"]["ARCH"], "${{ matrix.arch }}") for arch, code in (("x86_64", 0), ("aarch64", 0), ("riscv64", 1), ("amd64", 1), ("", 1)): diff --git a/tests/test_house_rules.py b/tests/test_house_rules.py index 161b49c..fd87f8c 100644 --- a/tests/test_house_rules.py +++ b/tests/test_house_rules.py @@ -166,7 +166,8 @@ class HouseRulesWiringTests(unittest.TestCase): job = workflow["jobs"]["house-rules"] self.assertEqual(workflow["permissions"], {"contents": "read"}) self.assertIn("timeout-minutes", job) - app, source, check = job["steps"] + steps = [s for s in job["steps"] if s.get("name") != "Harden runner"] + app, source, check = steps self.assertTrue(app["uses"].startswith("actions/checkout@")) self.assertEqual(app["with"]["persist-credentials"], "false") self.assertEqual(source["with"]["repository"], "storytold/craft-contrib") From 80cb1d6a31b256f271533ee0499b2a4d6b70a074 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 10 Nov 2026 07:28:44 -0500 Subject: [PATCH 03/11] ci: switch Harden-Runner egress-policy to block mode --- .github/workflows/ast-grep.yml | 2 +- .github/workflows/changed-paths.yml | 2 +- .github/workflows/docker-build.yml | 4 ++-- .github/workflows/flatpak-oci.yml | 2 +- .github/workflows/freebsd.yml | 2 +- .github/workflows/gate.yml | 2 +- .github/workflows/git-sources.yml | 2 +- .github/workflows/house-rules.yml | 2 +- .github/workflows/nix.yml | 2 +- .github/workflows/packaging-lint.yml | 2 +- .github/workflows/refresh-contributors.yml | 2 +- .github/workflows/release.yml | 24 +++++++++---------- .github/workflows/sonarcloud.yml | 8 +++---- .github/workflows/supply-chain.yml | 2 +- .github/workflows/test-ast-grep.yml | 2 +- .github/workflows/test-freebsd.yml | 2 +- .github/workflows/test-house-rules.yml | 2 +- .../workflows/test-install-apt-packages.yml | 2 +- .github/workflows/windows-arm64.yml | 4 ++-- 19 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ast-grep.yml b/.github/workflows/ast-grep.yml index 4f198c1..80fbe8c 100644 --- a/.github/workflows/ast-grep.yml +++ b/.github/workflows/ast-grep.yml @@ -38,7 +38,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/changed-paths.yml b/.github/workflows/changed-paths.yml index 777e636..1f96ba8 100644 --- a/.github/workflows/changed-paths.yml +++ b/.github/workflows/changed-paths.yml @@ -48,7 +48,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block # Two commits deep for the merge commit's first parent; trees only, no file contents. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 77ad337..1a73d63 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -110,7 +110,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - name: Check out uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -253,7 +253,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - name: Download digests uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: diff --git a/.github/workflows/flatpak-oci.yml b/.github/workflows/flatpak-oci.yml index 1bd8a16..ccd8f01 100644 --- a/.github/workflows/flatpak-oci.yml +++ b/.github/workflows/flatpak-oci.yml @@ -37,7 +37,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index 9840cbb..db9dc36 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -74,7 +74,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Check out craft-fonts if: inputs.craft-fonts-ref != '' diff --git a/.github/workflows/gate.yml b/.github/workflows/gate.yml index eded0bd..e95e159 100644 --- a/.github/workflows/gate.yml +++ b/.github/workflows/gate.yml @@ -121,7 +121,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/git-sources.yml b/.github/workflows/git-sources.yml index 1a51ee8..e4b6e02 100644 --- a/.github/workflows/git-sources.yml +++ b/.github/workflows/git-sources.yml @@ -30,7 +30,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/house-rules.yml b/.github/workflows/house-rules.yml index 1baca5a..2fa6558 100644 --- a/.github/workflows/house-rules.yml +++ b/.github/workflows/house-rules.yml @@ -33,7 +33,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 92d219a..233137a 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -21,7 +21,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23 - name: Check flake evaluation diff --git a/.github/workflows/packaging-lint.yml b/.github/workflows/packaging-lint.yml index 95a0c79..cb514bd 100644 --- a/.github/workflows/packaging-lint.yml +++ b/.github/workflows/packaging-lint.yml @@ -22,7 +22,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Run packaging lint uses: storytold/craft-common-actions/actions/packaging-lint@main diff --git a/.github/workflows/refresh-contributors.yml b/.github/workflows/refresh-contributors.yml index 8a92483..ab1b434 100644 --- a/.github/workflows/refresh-contributors.yml +++ b/.github/workflows/refresh-contributors.yml @@ -21,7 +21,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fcaf633..d49f599 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -151,7 +151,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Git dependencies come from storytold run: | @@ -198,7 +198,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - id: v name: Resolve version @@ -225,7 +225,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block # A signed job reads only the secrets the caller lists in its `secrets:` block; values come # from the repo's `release` environment. An unlisted name is empty, and the app's packaging # would then warn and ship unsigned, so on the release branch fail here instead. @@ -349,7 +349,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block # See the macOS job: unlisted secrets are empty, and the build would ship unsigned. # Signing needs either the PFX pair or all six Azure Trusted Signing values. - name: Require signing secrets on the release branch @@ -458,7 +458,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Load refreshed contributor credits if: inputs.contributors-artifact != '' @@ -555,7 +555,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Export the app's build variables id: app-env @@ -676,7 +676,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: @@ -739,7 +739,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - name: Check the FreeBSD architecture env: ARCH: ${{ matrix.arch }} @@ -972,7 +972,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Load refreshed contributor credits if: inputs.contributors-artifact != '' @@ -1048,7 +1048,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Load refreshed contributor credits if: inputs.contributors-artifact != '' @@ -1146,7 +1146,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Load refreshed contributor credits if: inputs.contributors-artifact != '' @@ -1201,7 +1201,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: storytold/craft-common-actions/actions/draft-release@main with: version: ${{ needs.version.outputs.version }} diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index d2cf617..e5a8989 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -69,7 +69,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -104,7 +104,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -179,7 +179,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -254,7 +254,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 diff --git a/.github/workflows/supply-chain.yml b/.github/workflows/supply-chain.yml index 5e1f1f9..0876059 100644 --- a/.github/workflows/supply-chain.yml +++ b/.github/workflows/supply-chain.yml @@ -25,7 +25,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - name: Download release artifacts uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: diff --git a/.github/workflows/test-ast-grep.yml b/.github/workflows/test-ast-grep.yml index f98b40b..7c51ca4 100644 --- a/.github/workflows/test-ast-grep.yml +++ b/.github/workflows/test-ast-grep.yml @@ -25,7 +25,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/test-freebsd.yml b/.github/workflows/test-freebsd.yml index c01cd78..a123c6e 100644 --- a/.github/workflows/test-freebsd.yml +++ b/.github/workflows/test-freebsd.yml @@ -26,7 +26,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install YAML parser run: sudo apt-get update && sudo apt-get install -y --no-install-recommends python3-yaml tcsh rpm debsigs dpkg-dev skopeo diff --git a/.github/workflows/test-house-rules.yml b/.github/workflows/test-house-rules.yml index d7f8254..ca67cf2 100644 --- a/.github/workflows/test-house-rules.yml +++ b/.github/workflows/test-house-rules.yml @@ -27,7 +27,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/test-install-apt-packages.yml b/.github/workflows/test-install-apt-packages.yml index fcef95a..cabf385 100644 --- a/.github/workflows/test-install-apt-packages.yml +++ b/.github/workflows/test-install-apt-packages.yml @@ -23,7 +23,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install packages uses: ./actions/install-apt-packages diff --git a/.github/workflows/windows-arm64.yml b/.github/workflows/windows-arm64.yml index bc64022..4c9c543 100644 --- a/.github/workflows/windows-arm64.yml +++ b/.github/workflows/windows-arm64.yml @@ -58,7 +58,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Check out craft-i18n uses: storytold/craft-common-actions/actions/checkout-craft-i18n@main @@ -98,7 +98,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: audit + egress-policy: block - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: name: ${{ inputs.app-name }}-windows-arm64 From df5f1fef9a1922c837ca24bfc6272060f7d94e18 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 10 Nov 2026 07:36:32 -0500 Subject: [PATCH 04/11] ci: specify allowed-endpoints for block mode in workflows --- .github/workflows/sonarcloud.yml | 60 +++++++++++++++++++ .github/workflows/test-ast-grep.yml | 5 ++ .github/workflows/test-freebsd.yml | 9 +++ .../workflows/test-install-apt-packages.yml | 9 +++ 4 files changed, 83 insertions(+) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index e5a8989..f0d9945 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -70,6 +70,21 @@ jobs: uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: egress-policy: block + allowed-endpoints: > + api.github.com:443 + archive.ubuntu.com:80 + azure.archive.ubuntu.com:80 + binaries.sonarsource.com:443 + crates.io:443 + github.com:443 + index.crates.io:443 + objects.githubusercontent.com:443 + release-assets.githubusercontent.com:443 + scanner.sonarcloud.io:443 + security.ubuntu.com:80 + sonarcloud.io:443 + static.crates.io:443 + static.rust-lang.org:443 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -105,6 +120,21 @@ jobs: uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: egress-policy: block + allowed-endpoints: > + api.github.com:443 + archive.ubuntu.com:80 + azure.archive.ubuntu.com:80 + binaries.sonarsource.com:443 + crates.io:443 + github.com:443 + index.crates.io:443 + objects.githubusercontent.com:443 + release-assets.githubusercontent.com:443 + scanner.sonarcloud.io:443 + security.ubuntu.com:80 + sonarcloud.io:443 + static.crates.io:443 + static.rust-lang.org:443 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -180,6 +210,21 @@ jobs: uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: egress-policy: block + allowed-endpoints: > + api.github.com:443 + archive.ubuntu.com:80 + azure.archive.ubuntu.com:80 + binaries.sonarsource.com:443 + crates.io:443 + github.com:443 + index.crates.io:443 + objects.githubusercontent.com:443 + release-assets.githubusercontent.com:443 + scanner.sonarcloud.io:443 + security.ubuntu.com:80 + sonarcloud.io:443 + static.crates.io:443 + static.rust-lang.org:443 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -255,6 +300,21 @@ jobs: uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: egress-policy: block + allowed-endpoints: > + api.github.com:443 + archive.ubuntu.com:80 + azure.archive.ubuntu.com:80 + binaries.sonarsource.com:443 + crates.io:443 + github.com:443 + index.crates.io:443 + objects.githubusercontent.com:443 + release-assets.githubusercontent.com:443 + scanner.sonarcloud.io:443 + security.ubuntu.com:80 + sonarcloud.io:443 + static.crates.io:443 + static.rust-lang.org:443 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 diff --git a/.github/workflows/test-ast-grep.yml b/.github/workflows/test-ast-grep.yml index 7c51ca4..d3e078e 100644 --- a/.github/workflows/test-ast-grep.yml +++ b/.github/workflows/test-ast-grep.yml @@ -26,6 +26,11 @@ jobs: uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: egress-policy: block + allowed-endpoints: > + api.github.com:443 + github.com:443 + objects.githubusercontent.com:443 + release-assets.githubusercontent.com:443 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/test-freebsd.yml b/.github/workflows/test-freebsd.yml index a123c6e..5e9f276 100644 --- a/.github/workflows/test-freebsd.yml +++ b/.github/workflows/test-freebsd.yml @@ -27,6 +27,15 @@ jobs: uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: egress-policy: block + allowed-endpoints: > + api.github.com:443 + github.com:443 + archive.ubuntu.com:80 + azure.archive.ubuntu.com:80 + security.ubuntu.com:80 + archive.ubuntu.com:443 + azure.archive.ubuntu.com:443 + security.ubuntu.com:443 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install YAML parser run: sudo apt-get update && sudo apt-get install -y --no-install-recommends python3-yaml tcsh rpm debsigs dpkg-dev skopeo diff --git a/.github/workflows/test-install-apt-packages.yml b/.github/workflows/test-install-apt-packages.yml index cabf385..2b7de84 100644 --- a/.github/workflows/test-install-apt-packages.yml +++ b/.github/workflows/test-install-apt-packages.yml @@ -24,6 +24,15 @@ jobs: uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: egress-policy: block + allowed-endpoints: > + api.github.com:443 + github.com:443 + archive.ubuntu.com:80 + azure.archive.ubuntu.com:80 + security.ubuntu.com:80 + archive.ubuntu.com:443 + azure.archive.ubuntu.com:443 + security.ubuntu.com:443 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Install packages uses: ./actions/install-apt-packages From 5a43790c93a1e2c7e3aff131d973a5c9cd1f0357 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 10 Nov 2026 07:38:36 -0500 Subject: [PATCH 05/11] ci: replace anchore/sbom-action with step-security/sbom-action Switch to the StepSecurity-maintained secure drop-in replacement pinned to v0.24.2 (28bb7d0d2869c9ab0e5571c93591747945819d39). --- .github/workflows/supply-chain.yml | 2 +- tests/test_supply_chain.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/supply-chain.yml b/.github/workflows/supply-chain.yml index 0876059..4fa5f79 100644 --- a/.github/workflows/supply-chain.yml +++ b/.github/workflows/supply-chain.yml @@ -53,7 +53,7 @@ jobs: done < "$PWD/release-files" - name: Generate the CycloneDX SBOM - uses: anchore/sbom-action@66cbf4bc1f1c0d2edc94016e65bc221b6bb0ad6c # v0.24.3 + uses: step-security/sbom-action@28bb7d0d2869c9ab0e5571c93591747945819d39 # v0.24.2 with: path: subjects format: cyclonedx-json diff --git a/tests/test_supply_chain.py b/tests/test_supply_chain.py index 1c53f5c..49b5ac4 100644 --- a/tests/test_supply_chain.py +++ b/tests/test_supply_chain.py @@ -50,8 +50,8 @@ class SupplyChainOptInTests(unittest.TestCase): self.assertEqual(permissions["contents"], "write") uses = [step["uses"] for step in job["steps"] if "uses" in step] self.assertTrue(any(item.startswith("actions/attest@") for item in uses)) - self.assertTrue(any(item.startswith("anchore/sbom-action@") for item in uses)) - sbom = next(step for step in job["steps"] if step.get("uses", "").startswith("anchore/sbom-action@")) + self.assertTrue(any(item.startswith(("anchore/sbom-action@", "step-security/sbom-action@")) for item in uses)) + sbom = next(step for step in job["steps"] if step.get("uses", "").startswith(("anchore/sbom-action@", "step-security/sbom-action@"))) self.assertEqual(sbom["with"]["upload-release-assets"], "false") self.assertEqual(sbom["with"]["format"], "cyclonedx-json") @@ -64,7 +64,7 @@ class SupplyChainOptInTests(unittest.TestCase): steps = self.supply["jobs"]["attest"]["steps"] collection = next(step for step in steps if step.get("name") == "Collect release files") for index, step in enumerate(steps): - if step.get("uses", "").startswith(("anchore/sbom-action@", "actions/attest@")): + if step.get("uses", "").startswith(("anchore/sbom-action@", "step-security/sbom-action@", "actions/attest@")): self.assertLess(steps.index(collection), index) self.assertNotIn("if", step) self.assertNotIn("continue-on-error", collection) From 9e571bd6585ee9fcdce5e5f1d0ad55b93546e797 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 10 Nov 2026 07:41:42 -0500 Subject: [PATCH 06/11] ci: add allowed-endpoints to packaging-lint and house-rules workflows --- .github/workflows/house-rules.yml | 3 +++ .github/workflows/packaging-lint.yml | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/house-rules.yml b/.github/workflows/house-rules.yml index 2fa6558..b9f9796 100644 --- a/.github/workflows/house-rules.yml +++ b/.github/workflows/house-rules.yml @@ -34,6 +34,9 @@ jobs: uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: egress-policy: block + allowed-endpoints: > + api.github.com:443 + github.com:443 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/packaging-lint.yml b/.github/workflows/packaging-lint.yml index cb514bd..80bb8fe 100644 --- a/.github/workflows/packaging-lint.yml +++ b/.github/workflows/packaging-lint.yml @@ -23,6 +23,14 @@ jobs: uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: egress-policy: block + allowed-endpoints: > + api.github.com:443 + archive.ubuntu.com:80 + azure.archive.ubuntu.com:80 + github.com:443 + objects.githubusercontent.com:443 + release-assets.githubusercontent.com:443 + security.ubuntu.com:80 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Run packaging lint uses: storytold/craft-common-actions/actions/packaging-lint@main From 2edf8b6175a87bd3e375afa9bca5cf4f0afb1a8e Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 10 Nov 2026 07:54:57 -0500 Subject: [PATCH 07/11] ci: address review findings for Harden-Runner egress policy - Add allowed-endpoints to ast-grep.yml matching test-ast-grep.yml - Add pypi.org and files.pythonhosted.org to sonarcloud.yml for Python coverage - Add packages.microsoft.com:443 and https mirrors to apt allowed-endpoints - Set unvalidated reusable workflows (release, docker-build, gate, etc.) to audit mode --- .github/workflows/ast-grep.yml | 5 ++++ .github/workflows/changed-paths.yml | 2 +- .github/workflows/docker-build.yml | 4 ++-- .github/workflows/flatpak-oci.yml | 2 +- .github/workflows/freebsd.yml | 2 +- .github/workflows/gate.yml | 2 +- .github/workflows/git-sources.yml | 2 +- .github/workflows/nix.yml | 2 +- .github/workflows/packaging-lint.yml | 3 +++ .github/workflows/refresh-contributors.yml | 2 +- .github/workflows/release.yml | 24 +++++++++---------- .github/workflows/sonarcloud.yml | 20 ++++++++++++++++ .github/workflows/supply-chain.yml | 2 +- .github/workflows/test-freebsd.yml | 2 ++ .github/workflows/test-house-rules.yml | 3 +++ .../workflows/test-install-apt-packages.yml | 2 ++ .github/workflows/windows-arm64.yml | 4 ++-- 17 files changed, 59 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ast-grep.yml b/.github/workflows/ast-grep.yml index 80fbe8c..cc8c605 100644 --- a/.github/workflows/ast-grep.yml +++ b/.github/workflows/ast-grep.yml @@ -39,6 +39,11 @@ jobs: uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: egress-policy: block + allowed-endpoints: > + api.github.com:443 + github.com:443 + objects.githubusercontent.com:443 + release-assets.githubusercontent.com:443 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/changed-paths.yml b/.github/workflows/changed-paths.yml index 1f96ba8..777e636 100644 --- a/.github/workflows/changed-paths.yml +++ b/.github/workflows/changed-paths.yml @@ -48,7 +48,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit # Two commits deep for the merge commit's first parent; trees only, no file contents. - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 1a73d63..77ad337 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -110,7 +110,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - name: Check out uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -253,7 +253,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - name: Download digests uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: diff --git a/.github/workflows/flatpak-oci.yml b/.github/workflows/flatpak-oci.yml index ccd8f01..1bd8a16 100644 --- a/.github/workflows/flatpak-oci.yml +++ b/.github/workflows/flatpak-oci.yml @@ -37,7 +37,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index db9dc36..9840cbb 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -74,7 +74,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Check out craft-fonts if: inputs.craft-fonts-ref != '' diff --git a/.github/workflows/gate.yml b/.github/workflows/gate.yml index e95e159..eded0bd 100644 --- a/.github/workflows/gate.yml +++ b/.github/workflows/gate.yml @@ -121,7 +121,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/git-sources.yml b/.github/workflows/git-sources.yml index e4b6e02..1a51ee8 100644 --- a/.github/workflows/git-sources.yml +++ b/.github/workflows/git-sources.yml @@ -30,7 +30,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 233137a..92d219a 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -21,7 +21,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23 - name: Check flake evaluation diff --git a/.github/workflows/packaging-lint.yml b/.github/workflows/packaging-lint.yml index 80bb8fe..52c4204 100644 --- a/.github/workflows/packaging-lint.yml +++ b/.github/workflows/packaging-lint.yml @@ -27,10 +27,13 @@ jobs: api.github.com:443 archive.ubuntu.com:80 azure.archive.ubuntu.com:80 + azure.archive.ubuntu.com:443 + packages.microsoft.com:443 github.com:443 objects.githubusercontent.com:443 release-assets.githubusercontent.com:443 security.ubuntu.com:80 + security.ubuntu.com:443 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Run packaging lint uses: storytold/craft-common-actions/actions/packaging-lint@main diff --git a/.github/workflows/refresh-contributors.yml b/.github/workflows/refresh-contributors.yml index ab1b434..8a92483 100644 --- a/.github/workflows/refresh-contributors.yml +++ b/.github/workflows/refresh-contributors.yml @@ -21,7 +21,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d49f599..fcaf633 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -151,7 +151,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Git dependencies come from storytold run: | @@ -198,7 +198,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - id: v name: Resolve version @@ -225,7 +225,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit # A signed job reads only the secrets the caller lists in its `secrets:` block; values come # from the repo's `release` environment. An unlisted name is empty, and the app's packaging # would then warn and ship unsigned, so on the release branch fail here instead. @@ -349,7 +349,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit # See the macOS job: unlisted secrets are empty, and the build would ship unsigned. # Signing needs either the PFX pair or all six Azure Trusted Signing values. - name: Require signing secrets on the release branch @@ -458,7 +458,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Load refreshed contributor credits if: inputs.contributors-artifact != '' @@ -555,7 +555,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Export the app's build variables id: app-env @@ -676,7 +676,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: @@ -739,7 +739,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - name: Check the FreeBSD architecture env: ARCH: ${{ matrix.arch }} @@ -972,7 +972,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Load refreshed contributor credits if: inputs.contributors-artifact != '' @@ -1048,7 +1048,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Load refreshed contributor credits if: inputs.contributors-artifact != '' @@ -1146,7 +1146,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Load refreshed contributor credits if: inputs.contributors-artifact != '' @@ -1201,7 +1201,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: storytold/craft-common-actions/actions/draft-release@main with: version: ${{ needs.version.outputs.version }} diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index f0d9945..bd46cc6 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -74,14 +74,19 @@ jobs: api.github.com:443 archive.ubuntu.com:80 azure.archive.ubuntu.com:80 + azure.archive.ubuntu.com:443 + packages.microsoft.com:443 binaries.sonarsource.com:443 crates.io:443 + files.pythonhosted.org:443 github.com:443 index.crates.io:443 objects.githubusercontent.com:443 + pypi.org:443 release-assets.githubusercontent.com:443 scanner.sonarcloud.io:443 security.ubuntu.com:80 + security.ubuntu.com:443 sonarcloud.io:443 static.crates.io:443 static.rust-lang.org:443 @@ -124,14 +129,19 @@ jobs: api.github.com:443 archive.ubuntu.com:80 azure.archive.ubuntu.com:80 + azure.archive.ubuntu.com:443 + packages.microsoft.com:443 binaries.sonarsource.com:443 crates.io:443 + files.pythonhosted.org:443 github.com:443 index.crates.io:443 objects.githubusercontent.com:443 + pypi.org:443 release-assets.githubusercontent.com:443 scanner.sonarcloud.io:443 security.ubuntu.com:80 + security.ubuntu.com:443 sonarcloud.io:443 static.crates.io:443 static.rust-lang.org:443 @@ -214,14 +224,19 @@ jobs: api.github.com:443 archive.ubuntu.com:80 azure.archive.ubuntu.com:80 + azure.archive.ubuntu.com:443 + packages.microsoft.com:443 binaries.sonarsource.com:443 crates.io:443 + files.pythonhosted.org:443 github.com:443 index.crates.io:443 objects.githubusercontent.com:443 + pypi.org:443 release-assets.githubusercontent.com:443 scanner.sonarcloud.io:443 security.ubuntu.com:80 + security.ubuntu.com:443 sonarcloud.io:443 static.crates.io:443 static.rust-lang.org:443 @@ -304,14 +319,19 @@ jobs: api.github.com:443 archive.ubuntu.com:80 azure.archive.ubuntu.com:80 + azure.archive.ubuntu.com:443 + packages.microsoft.com:443 binaries.sonarsource.com:443 crates.io:443 + files.pythonhosted.org:443 github.com:443 index.crates.io:443 objects.githubusercontent.com:443 + pypi.org:443 release-assets.githubusercontent.com:443 scanner.sonarcloud.io:443 security.ubuntu.com:80 + security.ubuntu.com:443 sonarcloud.io:443 static.crates.io:443 static.rust-lang.org:443 diff --git a/.github/workflows/supply-chain.yml b/.github/workflows/supply-chain.yml index 4fa5f79..64efa45 100644 --- a/.github/workflows/supply-chain.yml +++ b/.github/workflows/supply-chain.yml @@ -25,7 +25,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - name: Download release artifacts uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: diff --git a/.github/workflows/test-freebsd.yml b/.github/workflows/test-freebsd.yml index 5e9f276..fef7d55 100644 --- a/.github/workflows/test-freebsd.yml +++ b/.github/workflows/test-freebsd.yml @@ -32,6 +32,8 @@ jobs: github.com:443 archive.ubuntu.com:80 azure.archive.ubuntu.com:80 + azure.archive.ubuntu.com:443 + packages.microsoft.com:443 security.ubuntu.com:80 archive.ubuntu.com:443 azure.archive.ubuntu.com:443 diff --git a/.github/workflows/test-house-rules.yml b/.github/workflows/test-house-rules.yml index ca67cf2..1d3848b 100644 --- a/.github/workflows/test-house-rules.yml +++ b/.github/workflows/test-house-rules.yml @@ -28,6 +28,9 @@ jobs: uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: egress-policy: block + allowed-endpoints: > + api.github.com:443 + github.com:443 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/test-install-apt-packages.yml b/.github/workflows/test-install-apt-packages.yml index 2b7de84..9eb289d 100644 --- a/.github/workflows/test-install-apt-packages.yml +++ b/.github/workflows/test-install-apt-packages.yml @@ -29,6 +29,8 @@ jobs: github.com:443 archive.ubuntu.com:80 azure.archive.ubuntu.com:80 + azure.archive.ubuntu.com:443 + packages.microsoft.com:443 security.ubuntu.com:80 archive.ubuntu.com:443 azure.archive.ubuntu.com:443 diff --git a/.github/workflows/windows-arm64.yml b/.github/workflows/windows-arm64.yml index 4c9c543..bc64022 100644 --- a/.github/workflows/windows-arm64.yml +++ b/.github/workflows/windows-arm64.yml @@ -58,7 +58,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Check out craft-i18n uses: storytold/craft-common-actions/actions/checkout-craft-i18n@main @@ -98,7 +98,7 @@ jobs: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 with: - egress-policy: block + egress-policy: audit - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: name: ${{ inputs.app-name }}-windows-arm64 From 21875aea673bbc1c467d0d5feaabbd0abb64d26f Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 10 Nov 2026 07:56:22 -0500 Subject: [PATCH 08/11] ci: add GPG keyservers to sonarcloud.yml allowed-endpoints --- .github/workflows/sonarcloud.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index bd46cc6..12bebeb 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -84,6 +84,8 @@ jobs: objects.githubusercontent.com:443 pypi.org:443 release-assets.githubusercontent.com:443 + keys.openpgp.org:443 + keyserver.ubuntu.com:443 scanner.sonarcloud.io:443 security.ubuntu.com:80 security.ubuntu.com:443 @@ -139,6 +141,8 @@ jobs: objects.githubusercontent.com:443 pypi.org:443 release-assets.githubusercontent.com:443 + keys.openpgp.org:443 + keyserver.ubuntu.com:443 scanner.sonarcloud.io:443 security.ubuntu.com:80 security.ubuntu.com:443 @@ -234,6 +238,8 @@ jobs: objects.githubusercontent.com:443 pypi.org:443 release-assets.githubusercontent.com:443 + keys.openpgp.org:443 + keyserver.ubuntu.com:443 scanner.sonarcloud.io:443 security.ubuntu.com:80 security.ubuntu.com:443 @@ -329,6 +335,8 @@ jobs: objects.githubusercontent.com:443 pypi.org:443 release-assets.githubusercontent.com:443 + keys.openpgp.org:443 + keyserver.ubuntu.com:443 scanner.sonarcloud.io:443 security.ubuntu.com:80 security.ubuntu.com:443 From 0912de799d7f9e065f27ee5cf30569320cfe08e8 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 10 Nov 2026 07:57:48 -0500 Subject: [PATCH 09/11] ci: expand allowed-endpoints with wildcard domains for APT, GPG, and PyPI --- .github/workflows/packaging-lint.yml | 9 +++- .github/workflows/sonarcloud.yml | 76 ++++++++++++++++++++++------ 2 files changed, 68 insertions(+), 17 deletions(-) diff --git a/.github/workflows/packaging-lint.yml b/.github/workflows/packaging-lint.yml index 52c4204..09e3ccb 100644 --- a/.github/workflows/packaging-lint.yml +++ b/.github/workflows/packaging-lint.yml @@ -24,16 +24,23 @@ jobs: with: egress-policy: block allowed-endpoints: > + *.github.com:443 + *.githubusercontent.com:443 + *.microsoft.com:443 + *.ubuntu.com:80 + *.ubuntu.com:443 api.github.com:443 archive.ubuntu.com:80 + archive.ubuntu.com:443 azure.archive.ubuntu.com:80 azure.archive.ubuntu.com:443 - packages.microsoft.com:443 github.com:443 objects.githubusercontent.com:443 + packages.microsoft.com:443 release-assets.githubusercontent.com:443 security.ubuntu.com:80 security.ubuntu.com:443 + security.ubuntu.com:443 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Run packaging lint uses: storytold/craft-common-actions/actions/packaging-lint@main diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 12bebeb..bb18668 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -71,21 +71,32 @@ jobs: with: egress-policy: block allowed-endpoints: > + *.crates.io:443 + *.github.com:443 + *.githubusercontent.com:443 + *.microsoft.com:443 + *.openpgp.org:443 + *.pythonhosted.org:443 + *.sonarcloud.io:443 + *.sonarsource.com:443 + *.ubuntu.com:80 + *.ubuntu.com:443 api.github.com:443 archive.ubuntu.com:80 + archive.ubuntu.com:443 azure.archive.ubuntu.com:80 azure.archive.ubuntu.com:443 - packages.microsoft.com:443 binaries.sonarsource.com:443 crates.io:443 files.pythonhosted.org:443 github.com:443 index.crates.io:443 - objects.githubusercontent.com:443 - pypi.org:443 - release-assets.githubusercontent.com:443 keys.openpgp.org:443 keyserver.ubuntu.com:443 + objects.githubusercontent.com:443 + packages.microsoft.com:443 + pypi.org:443 + release-assets.githubusercontent.com:443 scanner.sonarcloud.io:443 security.ubuntu.com:80 security.ubuntu.com:443 @@ -128,21 +139,32 @@ jobs: with: egress-policy: block allowed-endpoints: > + *.crates.io:443 + *.github.com:443 + *.githubusercontent.com:443 + *.microsoft.com:443 + *.openpgp.org:443 + *.pythonhosted.org:443 + *.sonarcloud.io:443 + *.sonarsource.com:443 + *.ubuntu.com:80 + *.ubuntu.com:443 api.github.com:443 archive.ubuntu.com:80 + archive.ubuntu.com:443 azure.archive.ubuntu.com:80 azure.archive.ubuntu.com:443 - packages.microsoft.com:443 binaries.sonarsource.com:443 crates.io:443 files.pythonhosted.org:443 github.com:443 index.crates.io:443 - objects.githubusercontent.com:443 - pypi.org:443 - release-assets.githubusercontent.com:443 keys.openpgp.org:443 keyserver.ubuntu.com:443 + objects.githubusercontent.com:443 + packages.microsoft.com:443 + pypi.org:443 + release-assets.githubusercontent.com:443 scanner.sonarcloud.io:443 security.ubuntu.com:80 security.ubuntu.com:443 @@ -225,21 +247,32 @@ jobs: with: egress-policy: block allowed-endpoints: > + *.crates.io:443 + *.github.com:443 + *.githubusercontent.com:443 + *.microsoft.com:443 + *.openpgp.org:443 + *.pythonhosted.org:443 + *.sonarcloud.io:443 + *.sonarsource.com:443 + *.ubuntu.com:80 + *.ubuntu.com:443 api.github.com:443 archive.ubuntu.com:80 + archive.ubuntu.com:443 azure.archive.ubuntu.com:80 azure.archive.ubuntu.com:443 - packages.microsoft.com:443 binaries.sonarsource.com:443 crates.io:443 files.pythonhosted.org:443 github.com:443 index.crates.io:443 - objects.githubusercontent.com:443 - pypi.org:443 - release-assets.githubusercontent.com:443 keys.openpgp.org:443 keyserver.ubuntu.com:443 + objects.githubusercontent.com:443 + packages.microsoft.com:443 + pypi.org:443 + release-assets.githubusercontent.com:443 scanner.sonarcloud.io:443 security.ubuntu.com:80 security.ubuntu.com:443 @@ -322,21 +355,32 @@ jobs: with: egress-policy: block allowed-endpoints: > + *.crates.io:443 + *.github.com:443 + *.githubusercontent.com:443 + *.microsoft.com:443 + *.openpgp.org:443 + *.pythonhosted.org:443 + *.sonarcloud.io:443 + *.sonarsource.com:443 + *.ubuntu.com:80 + *.ubuntu.com:443 api.github.com:443 archive.ubuntu.com:80 + archive.ubuntu.com:443 azure.archive.ubuntu.com:80 azure.archive.ubuntu.com:443 - packages.microsoft.com:443 binaries.sonarsource.com:443 crates.io:443 files.pythonhosted.org:443 github.com:443 index.crates.io:443 - objects.githubusercontent.com:443 - pypi.org:443 - release-assets.githubusercontent.com:443 keys.openpgp.org:443 keyserver.ubuntu.com:443 + objects.githubusercontent.com:443 + packages.microsoft.com:443 + pypi.org:443 + release-assets.githubusercontent.com:443 scanner.sonarcloud.io:443 security.ubuntu.com:80 security.ubuntu.com:443 From 969c32dcf2705990f1fee5bc8d4d9c807d375dd8 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 10 Nov 2026 08:00:39 -0500 Subject: [PATCH 10/11] ci: allow SonarCloud S3 analysis sensor cache and scanner data endpoints --- .github/workflows/sonarcloud.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index bb18668..ea75519 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -71,7 +71,10 @@ jobs: with: egress-policy: block allowed-endpoints: > + *.amazonaws.com:443 *.crates.io:443 + *.s3.amazonaws.com:443 + *.s3.eu-central-1.amazonaws.com:443 *.github.com:443 *.githubusercontent.com:443 *.microsoft.com:443 @@ -139,7 +142,10 @@ jobs: with: egress-policy: block allowed-endpoints: > + *.amazonaws.com:443 *.crates.io:443 + *.s3.amazonaws.com:443 + *.s3.eu-central-1.amazonaws.com:443 *.github.com:443 *.githubusercontent.com:443 *.microsoft.com:443 @@ -247,7 +253,10 @@ jobs: with: egress-policy: block allowed-endpoints: > + *.amazonaws.com:443 *.crates.io:443 + *.s3.amazonaws.com:443 + *.s3.eu-central-1.amazonaws.com:443 *.github.com:443 *.githubusercontent.com:443 *.microsoft.com:443 @@ -355,7 +364,10 @@ jobs: with: egress-policy: block allowed-endpoints: > + *.amazonaws.com:443 *.crates.io:443 + *.s3.amazonaws.com:443 + *.s3.eu-central-1.amazonaws.com:443 *.github.com:443 *.githubusercontent.com:443 *.microsoft.com:443 From b24513e79507103b54ead46baa8ee76017f463e5 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Tue, 10 Nov 2026 16:40:36 +0100 Subject: [PATCH 11/11] fix(freebsd): cap the VM's ZFS ARC so big test crates aren't OOM-killed (#190) * fix(freebsd): give the VM a swap file and cap the ZFS ARC photocraft's FreeBSD job was SIGKILLed compiling photocraft-ui-egui's lib tests late in the run (release run 42609972735, dispatch 42805955303). Add an 8 GB swap file when the guest has none, cap the ARC at 2 GB when the image uses ZFS, and print disk, swap and memory so the next OOM is diagnosable. * fix(freebsd): only touch swap and the ARC inside a FreeBSD guest The workflow tests run the prepare script on Linux under sh -eu, where swapctl doesn't exist. Run the ARC cap, swap file and diagnostics only when uname is FreeBSD, and don't let the diagnostics fail the step. * fix(freebsd): add the swap file only with room to spare, and remove a partial one Per review: a dd that runs out of space must not leave a partial /var/swap0 that then starves the build. Require 16 GB free on /var first and delete the file if any step fails. * fix(freebsd): keep only the ZFS ARC cap; drop the swap-file fallback Per review: swap on a ZFS-backed file can hang FreeBSD under memory pressure, and today's image already has a swap partition, so the fallback never ran. The verified run passed on the ARC cap alone. --- .github/workflows/freebsd.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index 9840cbb..fe308b1 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -106,6 +106,19 @@ jobs: prepare: | # Keep rustup/proxies outside the Cargo data cache. unset CARGO_HOME CARGO_TARGET_DIR + # A large test crate's rustc (photocraft-ui-egui's lib tests) was SIGKILLed when the + # 12 GB guest ran out of memory late in a run: the image's root is ZFS with no ARC + # limit, so the ARC kept the target dir's pages. Cap it. (No swap file: swap on a + # ZFS-backed file can hang FreeBSD under memory pressure; the image has a 1 GB swap + # partition.) Print disk, swap and memory so the next OOM is easy to diagnose. + if [ "$(uname -s)" = FreeBSD ]; then + if sysctl -n vfs.zfs.arc_max >/dev/null 2>&1; then + sysctl vfs.zfs.arc_max=2147483648 || echo "::warning::could not cap the ZFS ARC" + fi + df -h / /var/tmp || true + swapctl -l || true + sysctl -n hw.physmem || true + fi if [ "${{ matrix.arch }}" = aarch64 ]; then # The host compiler and the aarch64 standard library come from the amd64 and # aarch64 lang/rust packages, which must be the same build. "latest" can build