.gitleaks.toml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. title = "Bambuddy gitleaks config"
  2. # Extend the built-in ruleset instead of replacing it.
  3. [extend]
  4. useDefault = true
  5. # ── Custom rules ─────────────────────────────────────────────────────────
  6. # Flag credentials embedded in URL userinfo, e.g.
  7. # http://USERNAME:PASSWORD@host/
  8. # gitleaks' default ruleset does not catch these because plain alphanumeric
  9. # passwords have no recognisable signature — only the URL structure does.
  10. [[rules]]
  11. id = "basic-auth-url"
  12. description = "Credentials in HTTP(S) URL userinfo"
  13. regex = '''https?://[^:/\s@]+:[^@/\s]{4,}@'''
  14. tags = ["credentials", "url"]
  15. [rules.allowlist]
  16. # Skip well-known dummy/example creds that legitimately appear in docs
  17. # and test fixtures, and template-literal interpolations in source code
  18. # (e.g. `http://${user}:${password}@...` — not an actual credential).
  19. regexes = [
  20. '''https?://user:pass(word)?@''',
  21. '''https?://admin:admin@''',
  22. '''https?://test:test@''',
  23. '''https?://example:example@''',
  24. '''https?://foo:bar@''',
  25. '''https?://[^:]+:password@''',
  26. '''https?://[^:]+:secret@''',
  27. # JS template literal http://${user}:${password}@
  28. '''https?://\$\{[^}]+\}:\$\{[^}]+\}@''',
  29. # Python f-string http://{username}:{password}@
  30. '''https?://\{[^}]+\}:\{[^}]+\}@''',
  31. ]
  32. # ── Global allowlist ─────────────────────────────────────────────────────
  33. [allowlist]
  34. description = "Global paths and patterns that never contain real secrets"
  35. paths = [
  36. '''(.*?)(png|jpg|jpeg|gif|svg|ico|webp|pdf)$''',
  37. '''frontend/dist/.*''',
  38. '''frontend/node_modules/.*''',
  39. '''backend/tests/fixtures/.*''',
  40. '''static/assets/.*''', # bundled frontend build output (minified JS/CSS)
  41. # Historical log file (deleted in working tree, still in git history).
  42. # Credentials inside have been rotated; allowlisted to keep future scans
  43. # from re-surfacing them as noise.
  44. '''bambutrack\.log\.1$''',
  45. ]