From 9ffc6a143f1fd9afd38084cd39d79b73b64fd2c4 Mon Sep 17 00:00:00 2001 From: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> Date: Sat, 23 May 2026 03:14:03 +0100 Subject: [PATCH] feat(security): fleet-wide workflow hardening (SHA pinning + permissions) --- .github/workflows/ci.yml | 26 ++++++++++++++------------ .github/workflows/codeql.yml | 2 ++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31fc124..d6d8601 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,8 @@ env: OTP_VERSION: '26.2' REBAR3_VERSION: '3.22.1' +permissions: read-all + jobs: ########################################################################### # Build Job @@ -30,7 +32,7 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 - name: Setup Erlang/OTP - uses: erlef/setup-beam@v1 + uses: erlef/setup-beam@ee09b1e59bb240681c382eb1f0abc6a04af72764 # v1 with: otp-version: ${{ env.OTP_VERSION }} rebar3-version: ${{ env.REBAR3_VERSION }} @@ -76,13 +78,13 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 - name: Setup Erlang/OTP - uses: erlef/setup-beam@v1 + uses: erlef/setup-beam@ee09b1e59bb240681c382eb1f0abc6a04af72764 # v1 with: otp-version: ${{ matrix.otp }} rebar3-version: ${{ env.REBAR3_VERSION }} - name: Download build artifacts - uses: actions/download-artifact@v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: name: build-artifacts path: _build/ @@ -111,13 +113,13 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 - name: Setup Erlang/OTP - uses: erlef/setup-beam@v1 + uses: erlef/setup-beam@ee09b1e59bb240681c382eb1f0abc6a04af72764 # v1 with: otp-version: ${{ env.OTP_VERSION }} rebar3-version: ${{ env.REBAR3_VERSION }} - name: Download build artifacts - uses: actions/download-artifact@v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: name: build-artifacts path: _build/ @@ -129,7 +131,7 @@ jobs: run: rebar3 cover --verbose - name: Upload coverage to Codecov - uses: codecov/codecov-action@v6 + uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6 with: files: _build/test/cover/cobertura.xml fail_ci_if_error: false @@ -148,7 +150,7 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 - name: Setup Erlang/OTP - uses: erlef/setup-beam@v1 + uses: erlef/setup-beam@ee09b1e59bb240681c382eb1f0abc6a04af72764 # v1 with: otp-version: ${{ env.OTP_VERSION }} rebar3-version: ${{ env.REBAR3_VERSION }} @@ -162,7 +164,7 @@ jobs: ${{ runner.os }}-plt- - name: Download build artifacts - uses: actions/download-artifact@v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: name: build-artifacts path: _build/ @@ -275,13 +277,13 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 - name: Setup Erlang/OTP - uses: erlef/setup-beam@v1 + uses: erlef/setup-beam@ee09b1e59bb240681c382eb1f0abc6a04af72764 # v1 with: otp-version: ${{ env.OTP_VERSION }} rebar3-version: ${{ env.REBAR3_VERSION }} - name: Download build artifacts - uses: actions/download-artifact@v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: name: build-artifacts path: _build/ @@ -311,7 +313,7 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 - name: Setup Erlang/OTP - uses: erlef/setup-beam@v1 + uses: erlef/setup-beam@ee09b1e59bb240681c382eb1f0abc6a04af72764 # v1 with: otp-version: ${{ env.OTP_VERSION }} rebar3-version: ${{ env.REBAR3_VERSION }} @@ -322,7 +324,7 @@ jobs: rebar3 as prod tar - name: Create GitHub Release - uses: softprops/action-gh-release@v3 + uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3 with: files: _build/prod/rel/safe_brute_force/*.tar.gz generate_release_notes: true diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d8898a7..168aeef 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -20,6 +20,8 @@ on: schedule: - cron: '37 15 * * 1' +permissions: read-all + jobs: analyze: name: Analyze (${{ matrix.language }})