fix(security): repair gitleaks config to prevent scanner panic - #23
Merged
Merged
Conversation
The .gitleaks.toml here was copied from a shared template with two
structural bugs that crash gitleaks 8.30 config loading before any
scan runs, failing the secrets job on every PR:
1. [allowlist.commits] was a nested TOML table, but gitleaks expects
AllowList.Commits as a flat string array. Decoding it as a map
crashes with "expected type 'string', got unconvertible type 'map'".
Fixed by moving `commits = []` to a flat key inside [allowlist].
2. Several `paths` entries used glob syntax (`**/*.test.ts`,
`.github/wiki/**`, etc.) but gitleaks paths are Go regexes, not
globs — glob syntax panics at config load ("missing argument to
repetition operator"). Replaced with equivalent valid regexes.
Also adds a shape-based allowlist regex for `process.env.X` /
`import.meta.env.X` references, which the hasura-admin-secret rule
was flagging as false positives (14 files reference
process.env.HASURA_GRAPHQL_ADMIN_SECRET as a variable, not a literal
secret).
Same structural fix already applied in ummeco/ummat PR #84 and
ummeco/praycalc PR #52.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
🟢 Rampart Security Gate — CLEAN
Totals: 0 critical · 0 high · 0 medium · 0 low Mode: |
README env-template block spilled HASURA_ADMIN_URL (a URL, not a secret) into the hasura-admin-secret capture group via history scan.
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
ummeco/ummatPR #84 /ummeco/praycalcPR #52:[allowlist.commits]nested table -> flatcommits = [], and globpaths(**/*.test.ts,.github/wiki/**, etc.) -> valid Go-regex equivalents. gitleaks 8.30 panics at config decode on both bugs, failing the secrets job on every PR before any scan runs.process.env.X/import.meta.env.Xreferences — thehasura-admin-secretrule was flagging 14 files that referenceprocess.env.HASURA_GRAPHQL_ADMIN_SECRETas a bare variable name, not a literal secret value.Test plan
gitleaks detect --config .gitleaks.toml --no-git --source .crashes at config load (confirms the bug) — "expected type 'string', got unconvertible type 'map'"process.env.HASURA_GRAPHQL_ADMIN_SECRETvariable references) -> 0 after adding the shape-based suppressiontomllib;[allowlist]keys confirmed flat (description,regexes,commits,paths)