Skip to content

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

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

acamarata merged 2 commits into
mainfrom
fix/T-P0-SECURITY-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 entries (**/*.test.ts, .github/docs/**, 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 shape-based allowlist regexes (env-var references via process.env.X/import.meta.env.X, shell ${VAR}/$VAR interpolation, numbered env-var identifiers) to clear 9 false-positive findings on tracked files — all were code reading Hasura/Anthropic env-var names, never literal secret values.
  • All existing custom rules (14 Ummat/Ummeco-specific rules) left unchanged.

Test plan

  • Original config crashes: 1 error(s) decoding: * 'AllowList.Commits[0]' expected type 'string', got unconvertible type 'map[string]interface {}'
  • Fixed config: gitleaks detect --config .gitleaks.toml --no-git --source . --exit-code 0 runs without panic
  • Findings on tracked files: N/A (crashed) before -> 9 FPs after structural fix -> 0 after shape-based suppression
  • Manually reviewed all 9 findings — confirmed each is process.env.X / import.meta.env.X / shell ${VAR} reference, never a literal secret
  • No real secrets found in this pass

Two structural bugs in .gitleaks.toml crash gitleaks 8.30 config
loading, failing the secrets job on every PR before any scan runs:

1. `[allowlist.commits]` as a nested TOML table decodes as a Go map,
   but gitleaks expects `AllowList.Commits` to be `[]string`. Flattened
   to a `commits = []` key inside `[allowlist]`.
2. Several `paths` entries used glob syntax (`**/*.test.ts`,
   `.github/docs/**`, etc.) which gitleaks compiles as Go regex —
   invalid glob patterns panic at config load. Replaced with
   equivalent valid regexes.

Also adds shape-based allowlist regexes for env-var references
(`process.env.X`, `import.meta.env.X`, shell `${VAR}` interpolation,
numbered env-var identifiers) to clear 9 false-positive findings on
tracked files (Hasura/Anthropic env-var reads, never literal secrets).

Same fix pattern as ummeco/praycalc PR #52 and ummeco/ummat PR #84.
No real secrets found during validation.
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
islamwiki Ready Ready Preview, Comment Jul 1, 2026 10:53pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ummat-islamwiki Ignored Ignored Preview Jul 1, 2026 10:53pm

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

Git-history mode scan (gitleaks detect, default GIT mode) surfaced 2
generic-api-key findings for the literal 'Alafasy_128kbps' — a Quran
reciter identifier / lookup key (Mishary Alafasy audio stream bitrate
variant), not a credential. Confirmed present in current HEAD source
(useAudioPlayer.ts, SettingsForm.tsx) as legitimate TypeScript union
type values, not a leaked secret.

Added a shape-based allowlist regex matching the '<Name>_<N>kbps'
reciter-key pattern so history-mode CI scans stop flagging it.
@acamarata
acamarata merged commit a6f9d69 into main Jul 1, 2026
10 of 14 checks passed
@acamarata
acamarata deleted the fix/T-P0-SECURITY-01-gitleaks-config-repair branch July 4, 2026 14:02
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