From c20418fb0333ce35812a0bf4929f6bbaef5e5791 Mon Sep 17 00:00:00 2001 From: "asha-docs[bot]" <304309749+asha-docs[bot]@users.noreply.github.com> Date: Mon, 21 Sep 2026 14:02:43 +0000 Subject: [PATCH 1/2] =?UTF-8?q?ci:=20gitleaks=20=E2=80=94=20hard=20gate=20?= =?UTF-8?q?on=20PRs,=20detect+rotate-alert=20on=20push=20(CJ=202026-09-20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gitleaks.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/gitleaks.yml diff --git a/.github/workflows/gitleaks.yml b/.github/workflows/gitleaks.yml new file mode 100644 index 0000000..bbcaa90 --- /dev/null +++ b/.github/workflows/gitleaks.yml @@ -0,0 +1,33 @@ +# Gitleaks — hard gate on code (PR), detection + rotate-alert on the data +# path (post-merge push). CJ ruling 2026-09-20; doctrine in README/GOVERNANCE: +# protection happens BEFORE publish. A PR scan can still prevent, so findings +# FAIL the PR. A post-merge scan can only detect, so it alerts and never +# rewrites history. Memory writes never ride PRs (the write door), so nothing +# here can ever block one. +name: gitleaks + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +jobs: + gitleaks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: gitleaks/gitleaks-action@v2 + continue-on-error: ${{ github.event_name == 'push' }} + env: + GITLEAKS_ENABLE_SUMMARY: "true" + + - name: post-publish finding note + if: github.event_name == 'push' && failure() + run: | + echo "::warning::gitleaks found candidate secrets in merged content — detection + rotate-alert, not protection (see the gitleaks summary)" From d9d51e8b9ef9bc3420905f9318d226a1bc03d32c Mon Sep 17 00:00:00 2001 From: "asha-docs[bot]" <304309749+asha-docs[bot]@users.noreply.github.com> Date: Sat, 3 Oct 2026 22:37:08 +0000 Subject: [PATCH 2/2] ci: switch gitleaks to free checksum-pinned CLI (fixes Vera QA findings) Replaces gitleaks/gitleaks-action@v2 (needs a paid org license, exits before scanning) with the MIT-licensed gitleaks CLI 8.30.1, checksum-pinned. PR scans block merge (--log-opts range); main pushes warn via step outcome (not the old never-firing failure() check). --- .github/workflows/gitleaks.yml | 37 +++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/gitleaks.yml b/.github/workflows/gitleaks.yml index bbcaa90..8e503f7 100644 --- a/.github/workflows/gitleaks.yml +++ b/.github/workflows/gitleaks.yml @@ -1,33 +1,38 @@ -# Gitleaks — hard gate on code (PR), detection + rotate-alert on the data -# path (post-merge push). CJ ruling 2026-09-20; doctrine in README/GOVERNANCE: -# protection happens BEFORE publish. A PR scan can still prevent, so findings -# FAIL the PR. A post-merge scan can only detect, so it alerts and never -# rewrites history. Memory writes never ride PRs (the write door), so nothing -# here can ever block one. +# Free: the MIT gitleaks CLI, not the separately licensed Action wrapper. +# PR scans block merge; main-push scans only warn (history is already published). name: gitleaks - on: pull_request: push: branches: [main] - permissions: contents: read - jobs: gitleaks: runs-on: ubuntu-latest + timeout-minutes: 5 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - - uses: gitleaks/gitleaks-action@v2 + persist-credentials: false + - name: Install checksum-pinned gitleaks CLI 8.30.1 + id: install + run: | + set -euo pipefail + cd "$RUNNER_TEMP" + curl -fsSL --max-time 60 -o gl.tar.gz \ + https://github.com/gitleaks/gitleaks/releases/download/v8.30.1/gitleaks_8.30.1_linux_x64.tar.gz + echo '551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb gl.tar.gz' | sha256sum --check --strict + tar -xzf gl.tar.gz gitleaks + test "$(./gitleaks version)" = '8.30.1' + - name: Scan only this event's commits + id: scan continue-on-error: ${{ github.event_name == 'push' }} env: - GITLEAKS_ENABLE_SUMMARY: "true" - - - name: post-publish finding note - if: github.event_name == 'push' && failure() + RANGE: ${{ github.event_name == 'pull_request' && format('{0}..{1}', github.event.pull_request.base.sha, github.event.pull_request.head.sha) || format('{0}..{1}', github.event.before, github.event.after) }} run: | - echo "::warning::gitleaks found candidate secrets in merged content — detection + rotate-alert, not protection (see the gitleaks summary)" + "$RUNNER_TEMP/gitleaks" git --no-banner --redact --exit-code 1 --log-opts="$RANGE" . + - name: Alert on a main-push finding + if: always() && github.event_name == 'push' && steps.scan.outcome == 'failure' + run: echo '::warning::gitleaks found candidates on main; operator review required.'