config.tmpl 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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|gltf)$''',
  15. '''(go.mod|go.sum|go.work|go.work.sum)$''',
  16. '''gradle.lockfile''',
  17. '''verification-metadata.xml''',
  18. '''node_modules''',
  19. '''package-lock.json''',
  20. '''yarn.lock''',
  21. '''pnpm-lock.yaml''',
  22. '''poetry.lock''',
  23. '''Database.refactorlog''',
  24. '''vendor''',
  25. ]
  26. {{ range $i, $rule := .Rules }}[[rules]]
  27. id = "{{$rule.RuleID}}"
  28. description = "{{$rule.Description}}"
  29. regex = '''{{$rule.Regex}}'''
  30. {{- with $rule.Path }}
  31. path = '''{{ . }}'''{{ end -}}
  32. {{- with $rule.SecretGroup }}
  33. secretGroup = {{ . }}{{ end -}}
  34. {{- with $rule.Entropy }}
  35. entropy = {{ . }}{{ end -}}
  36. {{- with $rule.Keywords }}
  37. keywords = [
  38. {{ range $j, $keyword := . }}"{{ $keyword }}",{{ end }}
  39. ]{{ end }}
  40. {{- with $rule.Tags }}
  41. tags = [
  42. {{ range $j, $tag := . }}"{{ $tag }}",{{ end }}
  43. ]{{ end }}
  44. {{ if or $rule.Allowlist.Regexes $rule.Allowlist.Paths $rule.Allowlist.Commits $rule.Allowlist.StopWords }}
  45. [rules.allowlist]
  46. {{ with $rule.Allowlist.RegexTarget }}
  47. regexTarget = "{{ . }}"{{ end -}}
  48. {{- with $rule.Allowlist.Regexes }}
  49. regexes = [
  50. {{ range $j, $regex := . }}'''{{ $regex }}''',{{ end }}
  51. ]{{ end }}
  52. {{- with $rule.Allowlist.Paths }}paths = [
  53. {{ range $j, $path := . }}"{{ $path }}",{{ end }}
  54. ]{{ end }}
  55. {{- with $rule.Allowlist.Commits }}commits = [
  56. {{ range $j, $commit := . }}"{{ $commit }}",{{ end }}
  57. ]{{ end }}
  58. {{- with $rule.Allowlist.StopWords }}stopwords = [{{ range $j, $stopword := . }}
  59. "{{ $stopword }}",{{ end }}
  60. ]{{ end }}
  61. {{ end }}
  62. {{ end }}