.gitleaks.toml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. Extend as new false positives show up.
  18. regexes = [
  19. '''https?://user:pass(word)?@''',
  20. '''https?://admin:admin@''',
  21. '''https?://test:test@''',
  22. '''https?://example:example@''',
  23. '''https?://foo:bar@''',
  24. '''https?://[^:]+:password@''',
  25. '''https?://[^:]+:secret@''',
  26. ]
  27. # ── Global allowlist ─────────────────────────────────────────────────────
  28. [allowlist]
  29. description = "Global paths and patterns that never contain real secrets"
  30. paths = [
  31. '''(.*?)(png|jpg|jpeg|gif|svg|ico|webp|pdf)$''',
  32. '''frontend/dist/.*''',
  33. '''frontend/node_modules/.*''',
  34. '''backend/tests/fixtures/.*''',
  35. '''static/assets/.*''', # bundled frontend build output (minified JS/CSS)
  36. ]