config.tmpl 1.9 KB

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