Skip to content

fix(security): repair gitleaks config to prevent scanner panic - #23

Merged
acamarata merged 2 commits into
mainfrom
fix/T-P7-SEC-01-gitleaks-config-repair
Jul 1, 2026
Merged

acamarata merged 2 commits into
mainfrom
fix/T-P7-SEC-01-gitleaks-config-repair

Conversation

@acamarata

Copy link
Copy Markdown
Contributor

Summary

  • Ports the gitleaks config-load crash fix from ummeco/ummat PR #84 / ummeco/praycalc PR #52: [allowlist.commits] nested table -> flat commits = [], and glob paths (**/*.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.
  • Adds one shape-based allowlist regex for process.env.X / import.meta.env.X references — the hasura-admin-secret rule was flagging 14 files that reference process.env.HASURA_GRAPHQL_ADMIN_SECRET as a bare variable name, not a literal secret value.
  • All pre-existing custom Ummat/Ummeco rules and other allowlist entries are unchanged.

Test plan

  • Original config: gitleaks detect --config .gitleaks.toml --no-git --source . crashes at config load (confirms the bug) — "expected type 'string', got unconvertible type 'map'"
  • Fixed config: same command runs without panic
  • Findings on tracked files: 15 (all process.env.HASURA_GRAPHQL_ADMIN_SECRET variable references) -> 0 after adding the shape-based suppression
  • No real secrets found in this repo during validation
  • TOML parses cleanly via Python tomllib; [allowlist] keys confirmed flat (description, regexes, commits, paths)

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.
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ummat-chatislam Ignored Ignored Preview Jul 1, 2026 10:43pm

Request Review

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

🟢 Rampart Security Gate — CLEAN

Tool CRITICAL HIGH MEDIUM LOW
(no findings)

Totals: 0 critical · 0 high · 0 medium · 0 low

Mode: RAMPART_ENFORCE=warn

README env-template block spilled HASURA_ADMIN_URL (a URL, not a
secret) into the hasura-admin-secret capture group via history scan.
@acamarata
acamarata merged commit 2e0d73f into main Jul 1, 2026
9 of 11 checks passed
@acamarata
acamarata deleted the fix/T-P7-SEC-01-gitleaks-config-repair branch July 4, 2026 00:46
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