config.tmpl 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. regexes = [
  13. '''219-09-9999''',
  14. '''078-05-1120''',
  15. '''(9[0-9]{2}|666)-\d{2}-\d{4}''',
  16. ]
  17. paths = [
  18. '''gitleaks.toml''',
  19. '''(.*?)(jpg|gif|doc|docx|zip|xls|pdf|bin|svg|socket)$''',
  20. '''(go.mod|go.sum)$''',
  21. '''node_modules''',
  22. '''vendor''',
  23. ]
  24. {{ range $i, $rule := .Rules }}[[rules]]
  25. {{ if and $rule.SecretGroup $rule.Entropy $rule.Allowlist.StopWords }}description = "{{$rule.Description}}"
  26. id = "{{$rule.RuleID}}"
  27. regex = '''{{$rule.Regex}}'''
  28. secretGroup = {{ $rule.SecretGroup }}
  29. entropy = {{ $rule.Entropy}}
  30. keywords = [
  31. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  32. ]
  33. [rules.allowlist]
  34. stopwords= [{{ range $j, $stopword := $rule.Allowlist.StopWords }}
  35. "{{$stopword}}",{{end}}
  36. ]
  37. {{ else if and $rule.SecretGroup $rule.Entropy }}description = "{{$rule.Description}}"
  38. id = "{{$rule.RuleID}}"
  39. regex = '''{{$rule.Regex}}'''
  40. secretGroup = {{ $rule.SecretGroup }}
  41. entropy = {{ $rule.Entropy}}
  42. keywords = [
  43. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  44. ]
  45. {{ else if $rule.SecretGroup }}description = "{{$rule.Description}}"
  46. id = "{{$rule.RuleID}}"
  47. regex = '''{{$rule.Regex}}'''
  48. secretGroup = {{ $rule.SecretGroup }}
  49. keywords = [
  50. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  51. ]
  52. {{ else }}description = "{{$rule.Description}}"
  53. id = "{{$rule.RuleID}}"
  54. regex = '''{{$rule.Regex}}'''
  55. keywords = [
  56. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  57. ]
  58. {{end}}{{end}}