config.tmpl 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # This is the default gitleaks configuration file.
  2. # Rules and allowlists are defined within this file.
  3. # Rules instruct gitleaks on what should be considered a secret.
  4. # Allowlists instruct gitleaks on what is allowed, i.e. not a secret.
  5. title = "gitleaks config"
  6. [allowlist]
  7. description = "global allow lists"
  8. regexes = [
  9. '''219-09-9999''',
  10. '''078-05-1120''',
  11. '''(9[0-9]{2}|666)-\d{2}-\d{4}''',
  12. ]
  13. paths = [
  14. '''gitleaks.toml''',
  15. '''(.*?)(jpg|gif|doc|pdf|bin|svg|socket)$''',
  16. '''(go.mod|go.sum)$'''
  17. ]
  18. {{ range $i, $rule := .Rules }}[[rules]]
  19. {{ if and $rule.SecretGroup $rule.Entropy $rule.Allowlist.StopWords }}description = "{{$rule.Description}}"
  20. id = "{{$rule.RuleID}}"
  21. regex = '''{{$rule.Regex}}'''
  22. secretGroup = {{ $rule.SecretGroup }}
  23. entropy = {{ $rule.Entropy}}
  24. keywords = [
  25. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  26. ]
  27. [rules.allowlist]
  28. stopwords= [{{ range $j, $stopword := $rule.Allowlist.StopWords }}
  29. "{{$stopword}}",{{end}}
  30. ]
  31. {{ else if and $rule.SecretGroup $rule.Entropy }}description = "{{$rule.Description}}"
  32. id = "{{$rule.RuleID}}"
  33. regex = '''{{$rule.Regex}}'''
  34. secretGroup = {{ $rule.SecretGroup }}
  35. entropy = {{ $rule.Entropy}}
  36. keywords = [
  37. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  38. ]
  39. {{ else if $rule.SecretGroup }}description = "{{$rule.Description}}"
  40. id = "{{$rule.RuleID}}"
  41. regex = '''{{$rule.Regex}}'''
  42. secretGroup = {{ $rule.SecretGroup }}
  43. keywords = [
  44. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  45. ]
  46. {{ else }}description = "{{$rule.Description}}"
  47. id = "{{$rule.RuleID}}"
  48. regex = '''{{$rule.Regex}}'''
  49. keywords = [
  50. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  51. ]
  52. {{end}}{{end}}