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