default.go 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. package config
  2. // DefaultConfig is the default gitleaks configuration. If --config={path-to-config} is set than the config located
  3. // at {path-to-config} will be used. Alternatively, if --repo-config is set then gitleaks will attempt to
  4. // use the config set in a gitleaks.toml or .gitleaks.toml file in the repo that is run with --repo-config set.
  5. const DefaultConfig = `
  6. title = "gitleaks config"
  7. [[rules]]
  8. description = "AWS Manager ID"
  9. regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
  10. tags = ["key", "AWS"]
  11. [[rules]]
  12. description = "AWS Secret Key"
  13. regex = '''(?i)aws(.{0,20})?(?-i)['\"][0-9a-zA-Z\/+]{40}['\"]'''
  14. tags = ["key", "AWS"]
  15. [[rules]]
  16. description = "AWS MWS key"
  17. regex = '''amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'''
  18. tags = ["key", "AWS", "MWS"]
  19. [[rules]]
  20. description = "Facebook Secret Key"
  21. regex = '''(?i)(facebook|fb)(.{0,20})?(?-i)['\"][0-9a-f]{32}['\"]'''
  22. tags = ["key", "Facebook"]
  23. [[rules]]
  24. description = "Facebook Client ID"
  25. regex = '''(?i)(facebook|fb)(.{0,20})?['\"][0-9]{13,17}['\"]'''
  26. tags = ["key", "Facebook"]
  27. [[rules]]
  28. description = "Twitter Secret Key"
  29. regex = '''(?i)twitter(.{0,20})?['\"][0-9a-z]{35,44}['\"]'''
  30. tags = ["key", "Twitter"]
  31. [[rules]]
  32. description = "Twitter Client ID"
  33. regex = '''(?i)twitter(.{0,20})?['\"][0-9a-z]{18,25}['\"]'''
  34. tags = ["client", "Twitter"]
  35. [[rules]]
  36. description = "Github"
  37. regex = '''(?i)github(.{0,20})?(?-i)['\"][0-9a-zA-Z]{35,40}['\"]'''
  38. tags = ["key", "Github"]
  39. [[rules]]
  40. description = "LinkedIn Client ID"
  41. regex = '''(?i)linkedin(.{0,20})?(?-i)['\"][0-9a-z]{12}['\"]'''
  42. tags = ["client", "LinkedIn"]
  43. [[rules]]
  44. description = "LinkedIn Secret Key"
  45. regex = '''(?i)linkedin(.{0,20})?['\"][0-9a-z]{16}['\"]'''
  46. tags = ["secret", "LinkedIn"]
  47. [[rules]]
  48. description = "Slack"
  49. regex = '''xox[baprs]-([0-9a-zA-Z]{10,48})?'''
  50. tags = ["key", "Slack"]
  51. [[rules]]
  52. description = "Asymmetric Private Key"
  53. regex = '''-----BEGIN (EC|PGP|DSA|RSA|OPENSSH) PRIVATE KEY( BLOCK)?-----'''
  54. tags = ["key", "AsymmetricPrivateKey"]
  55. [[rules]]
  56. description = "Generic Credential"
  57. regex = '''(?i)(api_key|apikey|secret)(.{0,20})?['|"][0-9a-zA-Z]{16,45}['|"]'''
  58. tags = ["key", "API", "generic"]
  59. [[rules]]
  60. description = "Google API key"
  61. regex = '''AIza[0-9A-Za-z\\-_]{35}'''
  62. tags = ["key", "Google"]
  63. [[rules]]
  64. description = "Heroku API key"
  65. regex = '''(?i)heroku(.{0,20})?['"][0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}['"]'''
  66. tags = ["key", "Heroku"]
  67. [[rules]]
  68. description = "MailChimp API key"
  69. regex = '''(?i)(mailchimp|mc)(.{0,20})?['"][0-9a-f]{32}-us[0-9]{1,2}['"]'''
  70. tags = ["key", "Mailchimp"]
  71. [[rules]]
  72. description = "Mailgun API key"
  73. regex = '''(?i)(mailgun|mg)(.{0,20})?['"][0-9a-z]{32}['"]'''
  74. tags = ["key", "Mailgun"]
  75. [[rules]]
  76. description = "PayPal Braintree access token"
  77. regex = '''access_token\$production\$[0-9a-z]{16}\$[0-9a-f]{32}'''
  78. tags = ["key", "Paypal"]
  79. [[rules]]
  80. description = "Picatic API key"
  81. regex = '''sk_live_[0-9a-z]{32}'''
  82. tags = ["key", "Picatic"]
  83. [[rules]]
  84. description = "SendGrid API Key"
  85. regex = '''SG\.[\w_]{16,32}\.[\w_]{16,64}'''
  86. tags = ["key", "SendGrid"]
  87. [[rules]]
  88. description = "Slack Webhook"
  89. regex = '''https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}'''
  90. tags = ["key", "slack"]
  91. [[rules]]
  92. description = "Stripe API key"
  93. regex = '''(?i)stripe(.{0,20})?['\"][sk|rk]_live_[0-9a-zA-Z]{24}'''
  94. tags = ["key", "Stripe"]
  95. [[rules]]
  96. description = "Square access token"
  97. regex = '''sq0atp-[0-9A-Za-z\-_]{22}'''
  98. tags = ["key", "square"]
  99. [[rules]]
  100. description = "Square OAuth secret"
  101. regex = '''sq0csp-[0-9A-Za-z\\-_]{43}'''
  102. tags = ["key", "square"]
  103. [[rules]]
  104. description = "Twilio API key"
  105. regex = '''(?i)twilio(.{0,20})?['\"][0-9a-f]{32}['\"]'''
  106. tags = ["key", "twilio"]
  107. [whitelist]
  108. description = "Whitelisted files"
  109. file = '''(^\.?gitleaks.toml$|(.*?)(jpg|gif|doc|pdf|bin)$)'''
  110. `