Skip to content

Allow benchmark model ids past the secret scan - #154

Merged
nlundee merged 1 commit into
mainfrom
fix-gitleaks-benchmark-keys
Oct 28, 2026
Merged

nlundee merged 1 commit into
mainfrom
fix-gitleaks-benchmark-keys

Conversation

@nlundee

@nlundee nlundee commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

What and why

CI fails on main and on every other branch because of a false positive in the secret scan. The scan checks the history of all branches (fetch-depth: 0), and gitleaks' default generic-api-key rule flags any "key" field. A benchmarks file on an open branch (#153, benchmarks/kudos-pilot/models.json) names its embedding setups under "key", for example qwen3-8b-1024. Those are names, not credentials.

This adds one allowlist entry to .gitleaks.toml. It applies only when both conditions hold: the file is JSON under benchmarks/, and the line is a "key" whose value is only lowercase letters, digits, dots and dashes. Secrets in other paths or fields, or with other characters, are still caught.

How it was tested

  • Ran ghcr.io/gitleaks/gitleaks:v8.28.0 git /repo --redact --exit-code 1 on a fresh clone with all branches, the same command CI runs. Before the change it found 1 leak, the benchmark model id. After the change it found none (107 commits scanned).

  • I checked the flagged value's shape without printing it: 13 characters, only lowercase letters, digits and dashes, like the other model ids in the file.

  • npm run check passes (not run: only .gitleaks.toml changes, and the check does not read it)

Checklist

  • Every new rule has a test whose name states it (no code rule; the scan above is the test)
  • User-facing text is in the i18n catalogues, in bokmål and English, with no em-dashes
  • Vendor SDKs stay in packages/providers-*
  • ADRs, docs and docs/architecture/modules are updated if a contract, boundary or module changed
  • No secrets, personal data or local paths

The secret scan reads every branch, and the generic API key rule flags
any "key" field. A benchmark models file on an open branch names its
embedding setups under "key", so CI failed on main and every other
branch. The allowlist covers only JSON under benchmarks/ where the key
is lowercase letters, digits, dots and dashes.
@nlundee
nlundee merged commit 699e0e1 into main Oct 28, 2026
11 checks passed
@nlundee
nlundee deleted the fix-gitleaks-benchmark-keys branch October 28, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant