fix(ci): replace broken gitleaks 'rule-as-allowlist' with proper allowlist#1
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the broken gitleaks "rule-as-allowlist" pattern with a correctly-scoped
[allowlist]. The previous config attempted to use[[rules]]withtags = ["allowlist"]to silence findings, but in gitleakstagsis purely metadata — the rule still fires. Worse, the rule's regex(?i)(fake|example|placeholder|test|dummy|sample)matches everydata-testid,testing-library,:latest,samplerArg, andparentbased_traceidratiosubstring across the codebase, producing a false-positive storm in CI.What changed
[[rules]] id = "test-fixtures"block.[allowlist]containing:EXAMPLE_,_PLACEHOLDER,magnon.io/patterns.data-testid,testing-library,samplerArg,parentbased_traceidratio.:latest,:staging,:main,:develop).FAKE_PASSWORD,EXAMPLE_TOKEN, etc.).PLACEHOLDER_SEAL_WITH_KUBESEALetc.).sealed-secret-encrypted-datadetection rule with a per-ruleallowlist.regexes = [".*"]to permit kubeseal ciphertext.Why this is safe
Detection is NOT relaxed beyond known false positives. Validated locally with gitleaks 8.30.0:
data-testid='login-button'andsamplerArg=parentbased_traceidratio.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
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