config.tmpl 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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)$''',
  15. '''(go.mod|go.sum)$''',
  16. '''node_modules''',
  17. '''package-lock.json''',
  18. '''pnpm-lock.yaml''',
  19. '''Database.refactorlog''',
  20. '''vendor''',
  21. ]
  22. {{ range $i, $rule := .Rules }}[[rules]]
  23. {{ if and $rule.SecretGroup $rule.Entropy $rule.Allowlist.StopWords }}description = "{{$rule.Description}}"
  24. id = "{{$rule.RuleID}}"
  25. regex = '''{{$rule.Regex}}'''
  26. secretGroup = {{ $rule.SecretGroup }}
  27. entropy = {{ $rule.Entropy}}
  28. keywords = [
  29. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  30. ]
  31. [rules.allowlist]
  32. stopwords= [{{ range $j, $stopword := $rule.Allowlist.StopWords }}
  33. "{{$stopword}}",{{end}}
  34. ]
  35. {{ else if and $rule.SecretGroup $rule.Entropy }}description = "{{$rule.Description}}"
  36. id = "{{$rule.RuleID}}"
  37. regex = '''{{$rule.Regex}}'''
  38. secretGroup = {{ $rule.SecretGroup }}
  39. entropy = {{ $rule.Entropy}}
  40. keywords = [
  41. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  42. ]
  43. {{ else if $rule.SecretGroup }}description = "{{$rule.Description}}"
  44. id = "{{$rule.RuleID}}"
  45. regex = '''{{$rule.Regex}}'''
  46. secretGroup = {{ $rule.SecretGroup }}
  47. keywords = [
  48. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  49. ]
  50. {{ else }}description = "{{$rule.Description}}"
  51. id = "{{$rule.RuleID}}"
  52. regex = '''{{$rule.Regex}}'''
  53. keywords = [
  54. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  55. ]
  56. {{end}}{{end}}