From 2df83d3b24e24eb393bcd1e047e88cfb50432fb7 Mon Sep 17 00:00:00 2001 From: DmitriyLewen Date: Wed, 28 Aug 2024 08:30:35 +0600 Subject: [PATCH 1/2] fix(secret): use `.ey` keyword for JWT secret --- pkg/fanal/secret/builtin-rules.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/fanal/secret/builtin-rules.go b/pkg/fanal/secret/builtin-rules.go index 9cb0aa361025..a71d2767dc0a 100644 --- a/pkg/fanal/secret/builtin-rules.go +++ b/pkg/fanal/secret/builtin-rules.go @@ -604,7 +604,7 @@ var builtinRules = []Rule{ 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"}, + Keywords: []string{".ey"}, }, { ID: "linear-api-token", From 1e6a54a0473aef85a852e8c5dfc3c382589c7a60 Mon Sep 17 00:00:00 2001 From: DmitriyLewen Date: Fri, 30 Aug 2024 10:22:03 +0600 Subject: [PATCH 2/2] refactor: use `.eyJ` keyword for jwt-token --- pkg/fanal/secret/builtin-rules.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/fanal/secret/builtin-rules.go b/pkg/fanal/secret/builtin-rules.go index a71d2767dc0a..a83d8eba35ba 100644 --- a/pkg/fanal/secret/builtin-rules.go +++ b/pkg/fanal/secret/builtin-rules.go @@ -604,7 +604,7 @@ var builtinRules = []Rule{ 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{".ey"}, + Keywords: []string{".eyJ"}, }, { ID: "linear-api-token",