config.tmpl 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # This file has been auto-generated. Do not edit manually.
  2. # If you would like to contribute new rules, please use
  3. # cmd/generate/config/main.go and follow the contributing guidelines
  4. # at https://github.com/zricethezav/gitleaks/blob/master/CONTRIBUTING.md
  5. # This is the default gitleaks configuration file.
  6. # Rules and allowlists are defined within this file.
  7. # Rules instruct gitleaks on what should be considered a secret.
  8. # Allowlists instruct gitleaks on what is allowed, i.e. not a secret.
  9. title = "gitleaks config"
  10. [allowlist]
  11. description = "global allow lists"
  12. paths = [
  13. '''gitleaks.toml''',
  14. '''(.*?)(jpg|gif|doc|docx|zip|xls|pdf|bin|svg|socket|vsidx|v2|suo|wsuo|.dll|pdb|exe)$''',
  15. '''(go.mod|go.sum)$''',
  16. '''gradle.lockfile''',
  17. '''node_modules''',
  18. '''package-lock.json''',
  19. '''pnpm-lock.yaml''',
  20. '''Database.refactorlog''',
  21. '''vendor''',
  22. ]
  23. {{ range $i, $rule := .Rules }}[[rules]]
  24. {{ if and $rule.SecretGroup $rule.Entropy $rule.Allowlist.StopWords }}description = "{{$rule.Description}}"
  25. id = "{{$rule.RuleID}}"
  26. regex = '''{{$rule.Regex}}'''
  27. secretGroup = {{ $rule.SecretGroup }}
  28. entropy = {{ $rule.Entropy}}
  29. keywords = [
  30. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  31. ]
  32. [rules.allowlist]
  33. stopwords= [{{ range $j, $stopword := $rule.Allowlist.StopWords }}
  34. "{{$stopword}}",{{end}}
  35. ]
  36. {{ else if and $rule.SecretGroup $rule.Entropy }}description = "{{$rule.Description}}"
  37. id = "{{$rule.RuleID}}"
  38. regex = '''{{$rule.Regex}}'''
  39. secretGroup = {{ $rule.SecretGroup }}
  40. entropy = {{ $rule.Entropy}}
  41. keywords = [
  42. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  43. ]
  44. {{ else if $rule.SecretGroup }}description = "{{$rule.Description}}"
  45. id = "{{$rule.RuleID}}"
  46. regex = '''{{$rule.Regex}}'''
  47. secretGroup = {{ $rule.SecretGroup }}
  48. keywords = [
  49. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  50. ]
  51. {{ else }}description = "{{$rule.Description}}"
  52. id = "{{$rule.RuleID}}"
  53. regex = '''{{$rule.Regex}}'''
  54. keywords = [
  55. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  56. ]
  57. {{end}}{{end}}