Skip to content

Commit

Permalink
feat(secret): add built-in rule for JWT tokens (#5480)
Browse files Browse the repository at this point in the history
  • Loading branch information
very-doge-wow committed Nov 9, 2023
1 parent 91fc8da commit 2f5afa5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/fanal/secret/builtin-rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2f5afa5

Please sign in to comment.