From 86ab7b0ee89e91ec58332fa955c7dbcd098ceab2 Mon Sep 17 00:00:00 2001 From: Ryan Inch Date: Mon, 29 Jun 2026 00:39:28 -0400 Subject: [PATCH] Increase lint-and-test workflow security and tighten permissions What: sets permissions to none, pins calls to external actions to specific commits, and prevents credentials from actions/checkout from persisting. Why: to minimize the chance of the workflow being hacked or vulnerable to a supply chain hack (pinning the external action calls helps with this), and in preparation to globally restrict permissions for all Hubs Foundation workflows. Note: these security improvements were advised by the Zizmor tool and `GitHubSecurityLab/actions-permissions/monitor@bf82d13b9b10051d224345ab9184f5ede0a94289 #v1 Beta 9` --- .github/workflows/lint-and-test.yml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 8f1136d41..5024b3882 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -2,6 +2,8 @@ name: lint-and-test on: [push, workflow_dispatch] +permissions: {} + jobs: test-current: strategy: @@ -28,15 +30,17 @@ jobs: - 5432:5432 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false - - uses: erlef/setup-beam@v1 + - uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1 with: elixir-version: '1.16.3-otp-25' otp-version: '25.3.2.20' # When changing versions, change it everywhere (check the README). - - uses: actions/cache@v4 + - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: | deps @@ -107,14 +111,16 @@ jobs: - 5432:5432 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false - - uses: erlef/setup-beam@v1 + - uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1 with: elixir-version: ${{ matrix.versions.elixir }} otp-version: ${{ matrix.versions.otp }} - - uses: actions/cache@v4 + - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: | deps @@ -149,14 +155,16 @@ jobs: runs-on: 'ubuntu-24.04' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false - - uses: erlef/setup-beam@v1 + - uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1 with: elixir-version: ${{ matrix.versions.elixir }} otp-version: ${{ matrix.versions.otp }} - - uses: actions/cache@v4 + - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: | deps