feat(secret): add built-in rule for JWT tokens (#5480)

This commit is contained in:
very-doge-wow
2023-11-09 02:34:52 +01:00
committed by GitHub
parent 91fc8dac92
commit 2f5afa5f29

View File

@@ -49,6 +49,7 @@ var (
CategoryHubSpot = types.SecretRuleCategory("HubSpot")
CategoryIntercom = types.SecretRuleCategory("Intercom")
CategoryIonic = types.SecretRuleCategory("Ionic")
CategoryJWT = types.SecretRuleCategory("JWT")
CategoryLinear = types.SecretRuleCategory("Linear")
CategoryLob = types.SecretRuleCategory("Lob")
CategoryMailchimp = types.SecretRuleCategory("Mailchimp")
@@ -562,6 +563,14 @@ var builtinRules = []Rule{
Regex: MustCompile(`(?i)(ionic[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"](ion_[a-z0-9]{42})['\"]`),
Keywords: []string{"ionic"},
},
{
ID: "jwt-token",
Category: CategoryJWT,
Title: "JWT token",
Severity: "MEDIUM",
Regex: MustCompile(`ey[a-zA-Z0-9]{17,}\.ey[a-zA-Z0-9\/\\_-]{17,}\.(?:[a-zA-Z0-9\/\\_-]{10,}={0,2})?`),
Keywords: []string{"jwt"},
},
{
ID: "linear-api-token",
Category: CategoryLinear,