4
0

gitleaks.toml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  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 = "gcp-service-account"
  110. description = "Google (GCP) Service-account"
  111. regex = '''\"type\": \"service_account\"'''
  112. [[rules]]
  113. id = "heroku-api-key"
  114. description = "Heroku API Key"
  115. 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})['\"]'''
  116. [[rules]]
  117. id = "slack-web-hook"
  118. description = "Slack Webhook"
  119. regex = '''https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}'''
  120. [[rules]]
  121. id = "twilio-api-key"
  122. description = "Twilio API Key"
  123. regex = '''SK[0-9a-fA-F]{32}'''
  124. [[rules]]
  125. id = "age-secret-key"
  126. description = "Age secret key"
  127. regex = '''AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{58}'''
  128. [[rules]]
  129. id = "facebook-token"
  130. description = "Facebook token"
  131. regex = '''(?i)(facebook[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-f0-9]{32})['\"]'''
  132. [[rules]]
  133. id = "twitter-token"
  134. description = "Twitter token"
  135. regex = '''(?i)(twitter[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-f0-9]{35,44})['\"]'''
  136. [[rules]]
  137. id = "adobe-client-id"
  138. description = "Adobe Client ID (Oauth Web)"
  139. regex = '''(?i)(adobe[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-f0-9]{32})['\"]'''
  140. [[rules]]
  141. id = "adobe-client-secret"
  142. description = "Adobe Client Secret"
  143. regex = '''(p8e-)(?i)[a-z0-9]{32}'''
  144. [[rules]]
  145. id = "alibaba-access-key-id"
  146. description = "Alibaba AccessKey ID"
  147. regex = '''(LTAI)(?i)[a-z0-9]{20}'''
  148. [[rules]]
  149. id = "alibaba-secret-key"
  150. description = "Alibaba Secret Key"
  151. regex = '''(?i)(alibaba[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{30})['\"]'''
  152. [[rules]]
  153. id = "asana-client-id"
  154. description = "Asana Client ID"
  155. regex = '''(?i)(asana[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([0-9]{16})['\"]'''
  156. [[rules]]
  157. id = "asana-client-secret"
  158. description = "Asana Client Secret"
  159. regex = '''(?i)(asana[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{32})['\"]'''
  160. [[rules]]
  161. id = "atlassian-api-token"
  162. description = "Atlassian API token"
  163. regex = '''(?i)(atlassian[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{24})['\"]'''
  164. [[rules]]
  165. id = "bitbucket-client-id"
  166. description = "Bitbucket client ID"
  167. regex = '''(?i)(bitbucket[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{32})['\"]'''
  168. [[rules]]
  169. description = "Bitbucket client secret"
  170. regex = '''(?i)(bitbucket[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9_\-]{64})['\"]'''
  171. [[rules]]
  172. description = "Beamer API token"
  173. regex = '''(?i)(beamer[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"](b_[a-z0-9=_\-]{44})['\"]'''
  174. [[rules]]
  175. description = "Clojars API token"
  176. regex = '''(CLOJARS_)(?i)[a-z0-9]{60}'''
  177. [[rules]]
  178. description = "Contentful delivery API token"
  179. regex = '''(?i)(contentful[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9\-=_]{43})['\"]'''
  180. [[rules]]
  181. description = "Contentful preview API token"
  182. regex = '''(?i)(contentful[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9\-=_]{43})['\"]'''
  183. [[rules]]
  184. description = "Databricks API token"
  185. regex = '''dapi[a-h0-9]{32}'''
  186. [[rules]]
  187. description = "Discord API key"
  188. regex = '''(?i)(discord[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-h0-9]{64})['\"]'''
  189. [[rules]]
  190. description = "Discord client ID"
  191. regex = '''(?i)(discord[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([0-9]{18})['\"]'''
  192. [[rules]]
  193. description = "Discord client secret"
  194. regex = '''(?i)(discord[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9=_\-]{32})['\"]'''
  195. [[rules]]
  196. description = "Doppler API token"
  197. regex = '''['\"](dp\.pt\.)(?i)[a-z0-9]{43}['\"]'''
  198. [[rules]]
  199. description = "Dropbox API secret/key"
  200. regex = '''(?i)(dropbox[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{15})['\"]'''
  201. [[rules]]
  202. description = "Dropbox short lived API token"
  203. regex = '''(?i)(dropbox[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"](sl\.[a-z0-9\-=_]{135})['\"]'''
  204. [[rules]]
  205. description = "Dropbox long lived API token"
  206. regex = '''(?i)(dropbox)(.{0,20})['\"](?i)[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9-_=]{43}['\"]'''
  207. [[rules]]
  208. description = "Duffel API token"
  209. regex = '''['\"]duffel_(test|live)_(?i)[a-z0-9_-]{43}['\"]'''
  210. [[rules]]
  211. description = "Dynatrace API token"
  212. regex = '''['\"]dt0c01\.(?i)[a-z0-9]{24}\.[a-z0-9]{64}['\"]'''
  213. [[rules]]
  214. description = "EasyPost API token"
  215. regex = '''['\"]EZAK(?i)[a-z0-9]{54}['\"]'''
  216. [[rules]]
  217. description = "EasyPost test API token"
  218. regex = '''['\"]EZTK(?i)[a-z0-9]{54}['\"]'''
  219. [[rules]]
  220. description = "Fastly API token"
  221. regex = '''(?i)(fastly[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9\-=_]{32})['\"]'''
  222. [[rules]]
  223. description = "Finicity client secret"
  224. regex = '''(?i)(finicity[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{20})['\"]'''
  225. [[rules]]
  226. description = "Finicity API token"
  227. regex = '''(?i)(finicity[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-f0-9]{32})['\"]'''
  228. [[rules]]
  229. description = "Flutterweave public key"
  230. regex = '''FLWPUBK_TEST-(?i)[a-h0-9]{32}-X'''
  231. [[rules]]
  232. description = "Flutterweave secret key"
  233. regex = '''FLWSECK_TEST-(?i)[a-h0-9]{32}-X'''
  234. [[rules]]
  235. description = "Flutterweave encrypted key"
  236. regex = '''FLWSECK_TEST[a-h0-9]{12}'''
  237. [[rules]]
  238. description = "Frame.io API token"
  239. regex = '''fio-u-(?i)[a-z0-9-_=]{64}'''
  240. [[rules]]
  241. description = "GoCardless API token"
  242. regex = '''['\"]live_(?i)[a-z0-9-_=]{40}['\"]'''
  243. [[rules]]
  244. description = "Grafana API token"
  245. regex = '''['\"]eyJrIjoi(?i)[a-z0-9-_=]{72,92}['\"]'''
  246. [[rules]]
  247. description = "Hashicorp Terraform user/org API token"
  248. regex = '''['\"](?i)[a-z0-9]{14}\.atlasv1\.[a-z0-9-_=]{60,70}['\"]'''
  249. [[rules]]
  250. description = "Hubspot API token"
  251. 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})['\"]'''
  252. [[rules]]
  253. description = "Intercom API token"
  254. regex = '''(?i)(intercom[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9=_]{60})['\"]'''
  255. [[rules]]
  256. description = "Intercom client secret/ID"
  257. 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})['\"]'''
  258. [[rules]]
  259. description = "Ionic API token"
  260. regex = '''ion_(?i)[a-z0-9]{42}'''
  261. [[rules]]
  262. description = "Linear API token"
  263. regex = '''lin_api_(?i)[a-z0-9]{40}'''
  264. [[rules]]
  265. description = "Linear client secret/ID"
  266. regex = '''(?i)(linear[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-f0-9]{32})['\"]'''
  267. [[rules]]
  268. description = "Lob API Key"
  269. regex = '''(?i)(lob[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]((live|test)_[a-f0-9]{35})['\"]'''
  270. [[rules]]
  271. description = "Lob Publishable API Key"
  272. regex = '''(?i)(lob[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]((test|live)_pub_[a-f0-9]{31})['\"]'''
  273. [[rules]]
  274. description = "Mailchimp API key"
  275. regex = '''(?i)(mailchimp[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-f0-9]{32}-us20)['\"]'''
  276. [[rules]]
  277. description = "Mailgun private API token"
  278. regex = '''(?i)(mailgun[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"](key-[a-f0-9]{32})['\"]'''
  279. [[rules]]
  280. description = "Mailgun public validation key"
  281. regex = '''(?i)(mailgun[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"](pubkey-[a-f0-9]{32})['\"]'''
  282. [[rules]]
  283. description = "Mailgun webhook signing key"
  284. regex = '''(?i)(mailgun[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-h0-9]{32}-[a-h0-9]{8}-[a-h0-9]{8})['\"]'''
  285. [[rules]]
  286. description = "Mapbox API token"
  287. regex = '''(?i)(pk\.[a-z0-9]{60}\.[a-z0-9]{22})'''
  288. [[rules]]
  289. description = "MessageBird API token"
  290. regex = '''(?i)(messagebird[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{25})['\"]'''
  291. [[rules]]
  292. description = "MessageBird API client ID"
  293. 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})['\"]'''
  294. [[rules]]
  295. description = "New Relic user API Key"
  296. regex = '''['\"](NRAK-[A-Z0-9]{27})['\"]'''
  297. [[rules]]
  298. description = "New Relic user API ID"
  299. regex = '''(?i)(newrelic[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([A-Z0-9]{64})['\"]'''
  300. [[rules]]
  301. description = "New Relic ingest browser API token"
  302. regex = '''['\"](NRJS-[a-f0-9]{19})['\"]'''
  303. [[rules]]
  304. description = "npm access token"
  305. regex = '''['\"](npm_(?i)[a-z0-9]{36})['\"]'''
  306. [[rules]]
  307. description = "Planetscale password"
  308. regex = '''pscale_pw_(?i)[a-z0-9\-_\.]{43}'''
  309. [[rules]]
  310. description = "Planetscale API token"
  311. regex = '''pscale_tkn_(?i)[a-z0-9\-_\.]{43}'''
  312. [[rules]]
  313. description = "Postman API token"
  314. regex = '''PMAK-(?i)[a-f0-9]{24}\-[a-f0-9]{34}'''
  315. [[rules]]
  316. description = "Pulumi API token"
  317. regex = '''pul-[a-f0-9]{40}'''
  318. [[rules]]
  319. description = "Rubygem API token"
  320. regex = '''rubygems_[a-f0-9]{48}'''
  321. [[rules]]
  322. description = "Sendgrid API token"
  323. regex = '''SG\.(?i)[a-z0-9_\-\.]{66}'''
  324. [[rules]]
  325. description = "Sendinblue API token"
  326. regex = '''xkeysib-[a-f0-9]{64}\-(?i)[a-z0-9]{16}'''
  327. [[rules]]
  328. description = "Shippo API token"
  329. regex = '''shippo_(live|test)_[a-f0-9]{40}'''
  330. [[rules]]
  331. description = "Linkedin Client secret"
  332. regex = '''(?i)(linkedin[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z]{16})['\"]'''
  333. [[rules]]
  334. description = "Linkedin Client ID"
  335. regex = '''(?i)(linkedin[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{14})['\"]'''
  336. [[rules]]
  337. description = "Twitch API token"
  338. regex = '''(?i)(twitch[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([a-z0-9]{30})['\"]'''
  339. [[rules]]
  340. description = "Typeform API token"
  341. regex = '''(?i)(typeform[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}(tfp_[a-z0-9\-_\.=]{59})'''
  342. # [[rules]]
  343. # id = "generic-api-key"
  344. # description = "Generic API Key"
  345. # regex = '''(?i)((key|api|token|secret|password)[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([0-9a-zA-Z\-_=]{8,64})['\"]'''
  346. # entropy = 3.7
  347. # entropyGroup = 4
  348. [allowlist]
  349. description = "global allow lists"
  350. regexes = ['''219-09-9999''', '''078-05-1120''', '''(9[0-9]{2}|666)-\d{2}-\d{4}''']
  351. paths = ['''(.*?)(jpg|gif|doc|pdf|bin|svg|socket)$''']