gitleaks.toml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. title = "gitleaks config"
  2. # Gitleaks rules are defined by regular expressions and entropy ranges.
  3. # Some secrets have unique signatures which make detecting those secrets easy.
  4. # Examples of those secrets would be Gitlab Personal Access Tokens, AWS keys, and Github Access Tokens.
  5. # All these examples have defined prefixes like `glpat`, `AKIA`, `ghp_`, etc.
  6. #
  7. # Other secrets might just be a hash which means we need to write more complex rules to verify
  8. # that what we are matching is a secret.
  9. #
  10. # Here is an example of a semi-generic secret
  11. #
  12. # discord_client_secret = "8dyfuiRyq=vVc3RRr_edRk-fK__JItpZ"
  13. #
  14. # We can write a regular expression to capture the variable name (identifier),
  15. # the assignment symbol (like '=' or ':='), and finally the actual secret.
  16. # The structure of a rule to match this example secret is below:
  17. #
  18. # Beginning string
  19. # quotation
  20. # │ End string quotation
  21. # │ │
  22. # ▼ ▼
  23. # (?i)(discord[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9=_\-]{32})['\"]
  24. #
  25. # ▲ ▲ ▲
  26. # │ │ │
  27. # │ │ │
  28. # identifier assignment symbol
  29. # Secret
  30. #
  31. [[rules]]
  32. id = "gitlab-pat"
  33. description = "GitLab Personal Access Token"
  34. regex = '''glpat-[0-9a-zA-Z\-]{20}'''
  35. [[rules]]
  36. id = "aws-access-token"
  37. description = "AWS"
  38. regex = '''AKIA[0-9A-Z]{16}'''
  39. # Cryptographic keys
  40. [[rules]]
  41. id = "PKCS8-PK"
  42. description = "PKCS8 private key"
  43. regex = '''-----BEGIN PRIVATE KEY-----'''
  44. [[rules]]
  45. id = "RSA-PK"
  46. description = "RSA private key"
  47. regex = '''-----BEGIN RSA PRIVATE KEY-----'''
  48. [[rules]]
  49. id = "OPENSSH-PK"
  50. description = "SSH private key"
  51. regex = '''-----BEGIN OPENSSH PRIVATE KEY-----'''
  52. [[rules]]
  53. id = "PGP-PK"
  54. description = "PGP private key"
  55. regex = '''-----BEGIN PGP PRIVATE KEY BLOCK-----'''
  56. [[rules]]
  57. id = "github-pat"
  58. description = "Github Personal Access Token"
  59. regex = '''ghp_[0-9a-zA-Z]{36}'''
  60. [[rules]]
  61. id = "github-oauth"
  62. description = "Github OAuth Access Token"
  63. regex = '''gho_[0-9a-zA-Z]{36}'''
  64. [[rules]]
  65. id = "SSH-DSA-PK"
  66. description = "SSH (DSA) private key"
  67. regex = '''-----BEGIN DSA PRIVATE KEY-----'''
  68. [[rules]]
  69. id = "SSH-EC-PK"
  70. description = "SSH (EC) private key"
  71. regex = '''-----BEGIN EC PRIVATE KEY-----'''
  72. [[rules]]
  73. id = "github-app-token"
  74. description = "Github App Token"
  75. regex = '''(ghu|ghs)_[0-9a-zA-Z]{36}'''
  76. [[rules]]
  77. id = "github-refresh-token"
  78. description = "Github Refresh Token"
  79. regex = '''ghr_[0-9a-zA-Z]{76}'''
  80. [[rules]]
  81. id = "shopify-shared-secret"
  82. description = "Shopify shared secret"
  83. regex = '''shpss_[a-fA-F0-9]{32}'''
  84. [[rules]]
  85. id = "shopify-access-token"
  86. description = "Shopify access token"
  87. regex = '''shpat_[a-fA-F0-9]{32}'''
  88. [[rules]]
  89. id = "shopify-custom-access-token"
  90. description = "Shopify custom app access token"
  91. regex = '''shpca_[a-fA-F0-9]{32}'''
  92. [[rules]]
  93. id = "shopify-private-app-access-token"
  94. description = "Shopify private app access token"
  95. regex = '''shppa_[a-fA-F0-9]{32}'''
  96. [[rules]]
  97. id = "slack-access-token"
  98. description = "Slack token"
  99. regex = '''xox[baprs]-([0-9a-zA-Z]{10,48})?'''
  100. [[rules]]
  101. id = "stripe-access-token"
  102. description = "Stripe"
  103. regex = '''(?i)(sk|pk)_(test|live)_[0-9a-z]{10,32}'''
  104. [[rules]]
  105. id = "pypi-upload-token"
  106. description = "PyPI upload token"
  107. regex = '''pypi-AgEIcHlwaS5vcmc[A-Za-z0-9-_]{50,1000}'''
  108. [[rules]]
  109. id = "generic-api-key"
  110. description = "Generic API Key"
  111. regex = '''(?i)((key|api|token|secret|password)[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([0-9a-zA-Z\-_=]{8,64})['\"]'''
  112. entropy = 3.7
  113. entropyGroup = 4
  114. # ➜ ~/code/gitleaks (v8) git show ec2fc9d6cb0954fb3b57201cf6133c48d8ca0d29 -- checks_test.go
  115. [[rules]]
  116. id = "gcp-service-account"
  117. description = "Google (GCP) Service-account"
  118. regex = '''\"type\": \"service_account\"'''
  119. [[rules]]
  120. id = "heroku-api-key"
  121. description = "Heroku API Key"
  122. regex = ''' (?i)(heroku[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})['\"]'''
  123. [[rules]]
  124. id = "slack-web-hook"
  125. description = "Slack Webhook"
  126. regex = '''https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}'''
  127. [[rules]]
  128. id = "twilio-api-key"
  129. description = "Twilio API Key"
  130. regex = '''SK[0-9a-fA-F]{32}'''
  131. [[rules]]
  132. id = "age-secret-key"
  133. description = "Age secret key"
  134. regex = '''AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}'''
  135. [[rules]]
  136. id = "facebook-token"
  137. description = "Facebook token"
  138. regex = '''(?i)(facebook[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-f0-9]{32})['\"]'''
  139. [[rules]]
  140. id = "twitter-token"
  141. description = "Twitter token"
  142. regex = '''(?i)(twitter[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-f0-9]{35,44})['\"]'''
  143. [[rules]]
  144. id = "adobe-client-id"
  145. description = "Adobe Client ID (Oauth Web)"
  146. regex = '''(?i)(adobe[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-f0-9]{32})['\"]'''
  147. [[rules]]
  148. id = "adobe-client-secret"
  149. description = "Adobe Client Secret"
  150. regex = '''(p8e-)(?i)[a-z0-9]{32}'''
  151. [[rules]]
  152. id = "alibaba-access-key-id"
  153. description = "Alibaba AccessKey ID"
  154. regex = '''(LTAI)(?i)[a-z0-9]{20}'''
  155. [[rules]]
  156. id = "alibaba-secret-key"
  157. description = "Alibaba Secret Key"
  158. regex = '''(?i)(alibaba[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{30})['\"]'''
  159. [[rules]]
  160. id = "asana-client-id"
  161. description = "Asana Client ID"
  162. regex = '''(?i)(asana[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([0-9]{16})['\"]'''
  163. [[rules]]
  164. id = "asana-client-secret"
  165. description = "Asana Client Secret"
  166. regex = '''(?i)(asana[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{32})['\"]'''
  167. [[rules]]
  168. id = "atlassian-api-token"
  169. description = "Atlassian API token"
  170. regex = '''(?i)(atlassian[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{24})['\"]'''
  171. [[rules]]
  172. id = "bitbucket-client-id"
  173. description = "Bitbucket client ID"
  174. regex = '''(?i)(bitbucket[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{32})['\"]'''
  175. [[rules]]
  176. description = "Bitbucket client secret"
  177. regex = '''(?i)(bitbucket[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9_\-]{64})['\"]'''
  178. [[rules]]
  179. description = "Beamer API token"
  180. regex = '''(?i)(beamer[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"](b_[a-z0-9=_\-]{44})['\"]'''
  181. [[rules]]
  182. description = "Clojars API token"
  183. regex = '''(CLOJARS_)(?i)[a-z0-9]{60}'''
  184. [[rules]]
  185. description = "Contentful delivery API token"
  186. regex = '''(?i)(contentful[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9\-=_]{43})['\"]'''
  187. [[rules]]
  188. description = "Contentful preview API token"
  189. regex = '''(?i)(contentful[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9\-=_]{43})['\"]'''
  190. [[rules]]
  191. description = "Databricks API token"
  192. regex = '''dapi[a-h0-9]{32}'''
  193. [[rules]]
  194. description = "Discord API key"
  195. regex = '''(?i)(discord[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-h0-9]{64})['\"]'''
  196. [[rules]]
  197. description = "Discord client ID"
  198. regex = '''(?i)(discord[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([0-9]{18})['\"]'''
  199. [[rules]]
  200. description = "Discord client secret"
  201. regex = '''(?i)(discord[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9=_\-]{32})['\"]'''
  202. [[rules]]
  203. description = "Doppler API token"
  204. regex = '''['\"](dp\.pt\.)(?i)[a-z0-9]{43}['\"]'''
  205. [[rules]]
  206. description = "Dropbox API secret/key"
  207. regex = '''(?i)(dropbox[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{15})['\"]'''
  208. [[rules]]
  209. description = "Dropbox short lived API token"
  210. regex = '''(?i)(dropbox[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"](sl\.[a-z0-9\-=_]{135})['\"]'''
  211. [[rules]]
  212. description = "Dropbox long lived API token"
  213. regex = '''(?i)(dropbox)(.{0,20})['\"](?i)[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9-_=]{43}['\"]'''
  214. [[rules]]
  215. description = "Duffel API token"
  216. regex = '''['\"]duffel_(test|live)_(?i)[a-z0-9_-]{43}['\"]'''
  217. [[rules]]
  218. description = "Dynatrace API token"
  219. regex = '''['\"]dt0c01\.(?i)[a-z0-9]{24}\.[a-z0-9]{64}['\"]'''
  220. [[rules]]
  221. description = "EasyPost API token"
  222. regex = '''['\"]EZAK(?i)[a-z0-9]{54}['\"]'''
  223. [[rules]]
  224. description = "EasyPost test API token"
  225. regex = '''['\"]EZTK(?i)[a-z0-9]{54}['\"]'''
  226. [[rules]]
  227. description = "Fastly API token"
  228. regex = '''(?i)(fastly[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9\-=_]{32})['\"]'''
  229. [[rules]]
  230. description = "Finicity client secret"
  231. regex = '''(?i)(finicity[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{20})['\"]'''
  232. [[rules]]
  233. description = "Finicity API token"
  234. regex = '''(?i)(finicity[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-f0-9]{32})['\"]'''
  235. [[rules]]
  236. description = "Flutterweave public key"
  237. regex = '''FLWPUBK_TEST-(?i)[a-h0-9]{32}-X'''
  238. [[rules]]
  239. description = "Flutterweave secret key"
  240. regex = '''FLWSECK_TEST-(?i)[a-h0-9]{32}-X'''
  241. [[rules]]
  242. description = "Flutterweave encrypted key"
  243. regex = '''FLWSECK_TEST[a-h0-9]{12}'''
  244. [[rules]]
  245. description = "Frame.io API token"
  246. regex = '''fio-u-(?i)[a-z0-9-_=]{64}'''
  247. [[rules]]
  248. description = "GoCardless API token"
  249. regex = '''['\"]live_(?i)[a-z0-9-_=]{40}['\"]'''
  250. [[rules]]
  251. description = "Grafana API token"
  252. regex = '''['\"]eyJrIjoi(?i)[a-z0-9-_=]{72,92}['\"]'''
  253. [[rules]]
  254. description = "Hashicorp Terraform user/org API token"
  255. regex = '''['\"](?i)[a-z0-9]{14}\.atlasv1\.[a-z0-9-_=]{60,70}['\"]'''
  256. [[rules]]
  257. description = "Hubspot API token"
  258. regex = '''(?i)(hubspot[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-h0-9]{8}-[a-h0-9]{4}-[a-h0-9]{4}-[a-h0-9]{4}-[a-h0-9]{12})['\"]'''
  259. [[rules]]
  260. description = "Intercom API token"
  261. regex = '''(?i)(intercom[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9=_]{60})['\"]'''
  262. [[rules]]
  263. description = "Intercom client secret/ID"
  264. regex = '''(?i)(intercom[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-h0-9]{8}-[a-h0-9]{4}-[a-h0-9]{4}-[a-h0-9]{4}-[a-h0-9]{12})['\"]'''
  265. [[rules]]
  266. description = "Ionic API token"
  267. regex = '''ion_(?i)[a-z0-9]{42}'''
  268. [[rules]]
  269. description = "Linear API token"
  270. regex = '''lin_api_(?i)[a-z0-9]{40}'''
  271. [[rules]]
  272. description = "Linear client secret/ID"
  273. regex = '''(?i)(linear[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-f0-9]{32})['\"]'''
  274. [[rules]]
  275. description = "Lob API Key"
  276. regex = '''(?i)(lob[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]((live|test)_[a-f0-9]{35})['\"]'''
  277. [[rules]]
  278. description = "Lob Publishable API Key"
  279. regex = '''(?i)(lob[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]((test|live)_pub_[a-f0-9]{31})['\"]'''
  280. [[rules]]
  281. description = "Mailchimp API key"
  282. regex = '''(?i)(mailchimp[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-f0-9]{32}-us20)['\"]'''
  283. [[rules]]
  284. description = "Mailgun private API token"
  285. regex = '''(?i)(mailgun[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"](key-[a-f0-9]{32})['\"]'''
  286. [[rules]]
  287. description = "Mailgun public validation key"
  288. regex = '''(?i)(mailgun[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"](pubkey-[a-f0-9]{32})['\"]'''
  289. [[rules]]
  290. description = "Mailgun webhook signing key"
  291. regex = '''(?i)(mailgun[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})['\"]'''
  292. [[rules]]
  293. description = "Mapbox API token"
  294. regex = '''(?i)(pk\.[a-z0-9]{60}\.[a-z0-9]{22})'''
  295. [[rules]]
  296. description = "MessageBird API token"
  297. regex = '''(?i)(messagebird[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{25})['\"]'''
  298. [[rules]]
  299. description = "MessageBird API client ID"
  300. regex = '''(?i)(messagebird[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-h0-9]{8}-[a-h0-9]{4}-[a-h0-9]{4}-[a-h0-9]{4}-[a-h0-9]{12})['\"]'''
  301. [[rules]]
  302. description = "New Relic user API Key"
  303. regex = '''['\"](NRAK-[A-Z0-9]{27})['\"]'''
  304. [[rules]]
  305. description = "New Relic user API ID"
  306. regex = '''(?i)(newrelic[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([A-Z0-9]{64})['\"]'''
  307. [[rules]]
  308. description = "New Relic ingest browser API token"
  309. regex = '''['\"](NRJS-[a-f0-9]{19})['\"]'''
  310. [[rules]]
  311. description = "npm access token"
  312. regex = '''['\"](npm_(?i)[a-z0-9]{36})['\"]'''
  313. [[rules]]
  314. description = "Planetscale password"
  315. regex = '''pscale_pw_(?i)[a-z0-9\-_\.]{43}'''
  316. [[rules]]
  317. description = "Planetscale API token"
  318. regex = '''pscale_tkn_(?i)[a-z0-9\-_\.]{43}'''
  319. [[rules]]
  320. description = "Postman API token"
  321. regex = '''PMAK-(?i)[a-f0-9]{24}\-[a-f0-9]{34}'''
  322. [[rules]]
  323. description = "Pulumi API token"
  324. regex = '''pul-[a-f0-9]{40}'''
  325. [[rules]]
  326. description = "Rubygem API token"
  327. regex = '''rubygems_[a-f0-9]{48}'''
  328. [[rules]]
  329. description = "Sendgrid API token"
  330. regex = '''SG\.(?i)[a-z0-9_\-\.]{66}'''
  331. [[rules]]
  332. description = "Sendinblue API token"
  333. regex = '''xkeysib-[a-f0-9]{64}\-(?i)[a-z0-9]{16}'''
  334. [[rules]]
  335. description = "Shippo API token"
  336. regex = '''shippo_(live|test)_[a-f0-9]{40}'''
  337. [[rules]]
  338. description = "Linkedin Client secret"
  339. regex = '''(?i)(linkedin[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z]{16})['\"]'''
  340. [[rules]]
  341. description = "Linkedin Client ID"
  342. regex = '''(?i)(linkedin[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{14})['\"]'''
  343. [[rules]]
  344. description = "Twitch API token"
  345. regex = '''(?i)(twitch[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{30})['\"]'''
  346. [[rules]]
  347. description = "Typeform API token"
  348. regex = '''(?i)(typeform[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}(tfp_[a-z0-9\-_\.=]{59})'''
  349. [allowlist]
  350. description = "global allow lists"
  351. regexes = ['''219-09-9999''', '''078-05-1120''', '''(9[0-9]{2}|666)-\d{2}-\d{4}''']
  352. paths = ['''(.*?)(jpg|gif|doc|pdf|bin|svg|socket)$''']