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