constants.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package gitleaks
  2. const version = "1.25.0"
  3. const defaultGithubURL = "https://api.github.com/"
  4. const defaultThreadNum = 1
  5. const ErrExit = 2
  6. const LeakExit = 1
  7. const defaultConfig = `
  8. # This is a sample config file for gitleaks. You can configure gitleaks what to search for and what to whitelist.
  9. # The output you are seeing here is the default gitleaks config. If GITLEAKS_CONFIG environment variable
  10. # is set, gitleaks will load configurations from that path. If option --config-path is set, gitleaks will load
  11. # configurations from that path. Gitleaks does not whitelist anything by default.
  12. title = "gitleaks config"
  13. # add regexes to the regex table
  14. [[regexes]]
  15. description = "AWS"
  16. regex = '''AKIA[0-9A-Z]{16}'''
  17. [[regexes]]
  18. description = "PKCS8"
  19. regex = '''-----BEGIN PRIVATE KEY-----'''
  20. [[regexes]]
  21. description = "RSA"
  22. regex = '''-----BEGIN RSA PRIVATE KEY-----'''
  23. [[regexes]]
  24. description = "SSH"
  25. regex = '''-----BEGIN OPENSSH PRIVATE KEY-----'''
  26. [[regexes]]
  27. description = "PGP"
  28. regex = '''-----BEGIN PGP PRIVATE KEY BLOCK-----'''
  29. [[regexes]]
  30. description = "Facebook"
  31. regex = '''(?i)facebook(.{0,4})?['\"][0-9a-f]{32}['\"]'''
  32. [[regexes]]
  33. description = "Twitter"
  34. regex = '''(?i)twitter(.{0,4})?['\"][0-9a-zA-Z]{35,44}['\"]'''
  35. [[regexes]]
  36. description = "Github"
  37. regex = '''(?i)github(.{0,4})?['\"][0-9a-zA-Z]{35,40}['\"]'''
  38. [[regexes]]
  39. description = "Slack"
  40. regex = '''xox[baprs]-([0-9a-zA-Z]{10,48})?'''
  41. [entropy]
  42. lineregexes = [
  43. "api",
  44. "key",
  45. "signature",
  46. "secret",
  47. "password",
  48. "pass",
  49. "pwd",
  50. "token",
  51. "curl",
  52. "wget",
  53. "https?",
  54. ]
  55. [whitelist]
  56. files = [
  57. "(.*?)(jpg|gif|doc|pdf|bin)$"
  58. ]
  59. #commits = [
  60. # "BADHA5H1",
  61. # "BADHA5H2",
  62. #]
  63. #repos = [
  64. # "mygoodrepo"
  65. #]
  66. [misc]
  67. #entropy = [
  68. # "3.3-4.30"
  69. # "6.0-8.0
  70. #]
  71. `