Commit 9926492
authored
ci(repo): add gitleaks secret scanning CI gate (#216)
* chore: add gitleaks secret scanning CI gate
Adds a PR-gate + scheduled full-history gitleaks scan. No .gitleaks.toml
needed: a full-history scan of this repo came back clean (zero findings),
so no allowlist tuning required.
* fix: pin gitleaks version instead of resolving latest dynamically
The dynamic lookup (curl api.github.com/.../releases/latest, unauthenticated)
got rate-limited on the runner's shared IP, silently emptied $VERSION, and
tripped `set -e` before printing anything -- reproduced the failure mode
locally. Pinning avoids the extra network call/rate-limit risk entirely and
makes the install step reproducible. Also adds `set -euo pipefail` and `-f`
on curl so any future failure here is loud instead of silent.
* harden: least-privilege permissions, concurrency, checksum-verified install
Addresses review feedback (Copilot on raiko2#147, Claude bot on alethia-reth#216),
verified empirically before applying:
- Add explicit `permissions: contents: read` and a `concurrency` group so
runs don't pile up on rapid pushes.
- `persist-credentials: false` on checkout -- this job never needs to push.
- Verify the downloaded gitleaks binary against its published SHA256 before
executing it, instead of trusting an unauthenticated curl download.
Did NOT apply two other review suggestions after testing them directly:
- DeepSeek (taiko-mono#21923) claimed `[allowlist].paths` needs gitignore-glob
syntax, not regex. Tested locally: a glob pattern crashes gitleaks
(`regexp: Compile(...): missing argument to repetition operator`). The
existing regex syntax is correct.
- Claude bot (alethia-reth#216) flagged `--log-opts="BASE..HEAD"` as
potentially broken. Tested locally with a real commit range: it correctly
scans exactly the PR's commits, nothing more/less. No change needed.
- Copilot also claimed this repo already pins actions to a commit SHA and
uses persist-credentials elsewhere -- checked, neither is actually true
here, so not introducing an inconsistent one-off pinning convention.1 parent 2bc92e6 commit 9926492
1 file changed
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
0 commit comments