Commit efc711e
committed
fix(ci): allowlist dummy test key in gitleaks scan
The dummy value `sk-secret-key-1234567890` in test/tools.test.ts trips
gitleaks' default `generic-api-key` rule (entropy 4.02) and fails the
Secret Scan job on PR #1. It is a test-only fixture explicitly endorsed
by AGENTS.md ("Tests use dummy values ... sk-secret-key-…"), and the
literal value is asserted by the redaction test at line 183, so it
cannot be changed.
An inline `// gitleaks:allow` comment suppresses file-level scans but
NOT gitleaks' PR-range scan: gitleaks inspects each commit patch
separately, and the secret was introduced in 17822e7 before any allow
comment existed, so that patch is still flagged. A per-line comment
cannot retroactively suppress a finding in an earlier commit's patch.
Fix: add .gitleaks.toml that extends the built-in default config
(`extend = { useDefault = true }`, keeping every default rule) and
allowlists only the exact dummy string via a global [allowlist] regex.
Real Bailian keys (sk-ws-…) are never allowlisted. Verified locally with
gitleaks 8.24.3 (matching CI): the PR commit range scans clean.1 parent a206dcb commit efc711e
2 files changed
Lines changed: 16 additions & 1 deletion
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
0 commit comments