Przeglądaj źródła

Pypi GitHub rules (#546)

* adding pypi and basic azure rules

* Adding new github format
Zachary Rice 4 lat temu
rodzic
commit
190877a24b
1 zmienionych plików z 7 dodań i 2 usunięć
  1. 7 2
      config/default.go

+ 7 - 2
config/default.go

@@ -42,8 +42,8 @@ title = "gitleaks config"
 	tags = ["client", "Twitter"]
 	tags = ["client", "Twitter"]
 
 
 [[rules]]
 [[rules]]
-	description = "Github"
-	regex = '''(?i)github.{0,3}((?i)token|api|key).{0,10}?(?-i)([0-9a-zA-Z]{35,40})'''
+	description = "Github Auth Token"
+	regex = '''(ghp|gho|ghu|ghs|ghr)_[0-9a-zA-Z]{32-40}'''
 	tags = ["key", "Github"]
 	tags = ["key", "Github"]
 
 
 [[rules]]
 [[rules]]
@@ -156,6 +156,11 @@ title = "gitleaks config"
 	regex = '''shppa_[a-fA-F0-9]{32}'''
 	regex = '''shppa_[a-fA-F0-9]{32}'''
 	tags = ["key", "Shopify"]
 	tags = ["key", "Shopify"]
 
 
+[[rules]]
+    description = "PyPI upload token"
+    regex = '''pypi-AgEIcHlwaS5vcmc[A-Za-z0-9-_]{50,1000}'''
+	tags = ["key", "pypi"]
+
 [allowlist]
 [allowlist]
 	description = "Allowlisted files"
 	description = "Allowlisted files"
 	files = ['''^\.?gitleaks.toml$''',
 	files = ['''^\.?gitleaks.toml$''',