config.tmpl 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # This is the default gitleaks configuration file.
  2. # Rules and allowlists are defined within this file.
  3. # Rules instruct gitleaks on what should be considered a secret.
  4. # Allowlists instruct gitleaks on what is allowed, i.e. not a secret.
  5. title = "gitleaks config"
  6. [allowlist]
  7. description = "global allow lists"
  8. regexes = [
  9. '''219-09-9999''',
  10. '''078-05-1120''',
  11. '''(9[0-9]{2}|666)-\d{2}-\d{4}''',
  12. ]
  13. paths = [
  14. '''gitleaks.toml''',
  15. '''(.*?)(jpg|gif|doc|pdf|bin|svg|socket)$''',
  16. '''(go.mod|go.sum)$'''
  17. ]
  18. {{ range $i, $rule := .Rules }}[[rules]]
  19. {{ if and $rule.SecretGroup $rule.Entropy }}description = "{{$rule.Description}}"
  20. id = "{{$rule.RuleID}}"
  21. regex = '''{{$rule.Regex}}'''
  22. secretGroup = {{ $rule.SecretGroup }}
  23. entropy = {{ $rule.Entropy}}
  24. keywords = [
  25. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  26. ]
  27. {{ else if $rule.SecretGroup }}description = "{{$rule.Description}}"
  28. id = "{{$rule.RuleID}}"
  29. regex = '''{{$rule.Regex}}'''
  30. secretGroup = {{ $rule.SecretGroup }}
  31. keywords = [
  32. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  33. ]
  34. {{ else }}description = "{{$rule.Description}}"
  35. id = "{{$rule.RuleID}}"
  36. regex = '''{{$rule.Regex}}'''
  37. keywords = [
  38. {{ range $j, $keyword := $rule.Keywords }}"{{$keyword}}",{{end}}
  39. ]
  40. {{end}}{{end}}