Skip to content

fix(ci): replace broken gitleaks 'rule-as-allowlist' with proper allowlist#1

Merged
jcrabtree merged 1 commit into
mainfrom
fix/gitleaks-broken-allowlist-p71
May 17, 2026
Merged

fix(ci): replace broken gitleaks 'rule-as-allowlist' with proper allowlist#1
jcrabtree merged 1 commit into
mainfrom
fix/gitleaks-broken-allowlist-p71

Conversation

@jcrabtree

Copy link
Copy Markdown

Summary

Replaces the broken gitleaks "rule-as-allowlist" pattern with a correctly-scoped [allowlist]. The previous config attempted to use [[rules]] with tags = ["allowlist"] to silence findings, but in gitleaks tags is purely metadata — the rule still fires. Worse, the rule's regex (?i)(fake|example|placeholder|test|dummy|sample) matches every data-testid, testing-library, :latest, samplerArg, and parentbased_traceidratio substring across the codebase, producing a false-positive storm in CI.

What changed

  • Removed the broken [[rules]] id = "test-fixtures" block.
  • Added a top-level [allowlist] containing:
    • The original EXAMPLE_, _PLACEHOLDER, magnon.io/ patterns.
    • The confirmed P58-audit false-positive patterns: data-testid, testing-library, samplerArg, parentbased_traceidratio.
    • Image-tag false positives (:latest, :staging, :main, :develop).
    • Compound placeholder patterns (FAKE_PASSWORD, EXAMPLE_TOKEN, etc.).
    • SealedSecret stub placeholders (PLACEHOLDER_SEAL_WITH_KUBESEAL etc.).
  • Added a sealed-secret-encrypted-data detection rule with a per-rule allowlist.regexes = [".*"] to permit kubeseal ciphertext.

Why this is safe

Detection is NOT relaxed beyond known false positives. Validated locally with gitleaks 8.30.0:

  • The fixed config silences data-testid='login-button' and samplerArg=parentbased_traceidratio.
  • It still flags a synthetic Slack bot token (xoxb-...) as a leak — exit code 1.

Estate-wide context

This is part of a coordinated remediation (P71) fixing the same broken pattern in ~1,479 repositories across the Magnon estate. The canonical scaffolding template (Project-Aethra/cookiecutter-python/.gitleaks.toml) is fixed in the same wave to prevent future propagation.

Test plan

  • CI gitleaks job passes on this branch (was failing or producing noise before)
  • Confirm the file diff matches the canonical fixed config

Reference: https://github.com/gitleaks/gitleaks/blob/master/README.md#configuration

Generated as part of estate-wide P71 sweep.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

…wlist

Replace broken `[[rules]]` block (id=test-fixtures, tags=["allowlist"])
with a proper top-level [allowlist] plus per-rule allowlists.

In gitleaks, [[rules]] blocks are DETECTION rules. The `tags` field
is metadata only — adding `tags = ["allowlist"]` does NOT silence
findings; it just labels them. The previous config matched every
string containing test|fake|example|placeholder|dummy|sample
(case-insensitive), producing false positives on `data-testid`,
`testing-library`, `:latest` image tags, `samplerArg`, and
`parentbased_traceidratio` across the estate.

This commit:
- Removes the broken `test-fixtures` rule.
- Adds a properly-scoped [allowlist] with the confirmed false-positive
  patterns from the P58 audit (incl. data-testid, testing-library,
  samplerArg, parentbased_traceidratio, image tags, kubeseal placeholders).
- Adds a per-rule allowlist on a new `sealed-secret-encrypted-data`
  detection rule so kubeseal ciphertext is not flagged.

Reference: https://github.com/gitleaks/gitleaks/blob/master/README.md#configuration

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jcrabtree jcrabtree merged commit 4de31aa into main May 17, 2026
15 of 27 checks passed
@jcrabtree jcrabtree deleted the fix/gitleaks-broken-allowlist-p71 branch May 17, 2026 19:07
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