瀏覽代碼

Update gitleaks.toml (#1116)

Use Word Boundaries for EasyPost Tokens
wolframhaussig 2 年之前
父節點
當前提交
1fb3a77eb8
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      cmd/generate/config/rules/easypost.go
  2. 2 2
      config/gitleaks.toml

+ 2 - 2
cmd/generate/config/rules/easypost.go

@@ -12,7 +12,7 @@ func EasyPost() *config.Rule {
 	r := config.Rule{
 		Description: "EasyPost API token",
 		RuleID:      "easypost-api-token",
-		Regex:       regexp.MustCompile(`EZAK(?i)[a-z0-9]{54}`),
+		Regex:       regexp.MustCompile(`\bEZAK(?i)[a-z0-9]{54}`),
 		Keywords:    []string{"EZAK"},
 	}
 
@@ -28,7 +28,7 @@ func EasyPostTestAPI() *config.Rule {
 	r := config.Rule{
 		Description: "EasyPost test API token",
 		RuleID:      "easypost-test-api-token",
-		Regex:       regexp.MustCompile(`EZTK(?i)[a-z0-9]{54}`),
+		Regex:       regexp.MustCompile(`\bEZTK(?i)[a-z0-9]{54}`),
 		Keywords:    []string{"EZTK"},
 	}
 

+ 2 - 2
config/gitleaks.toml

@@ -357,7 +357,7 @@ keywords = [
 [[rules]]
 description = "EasyPost API token"
 id = "easypost-api-token"
-regex = '''EZAK(?i)[a-z0-9]{54}'''
+regex = '''\bEZAK(?i)[a-z0-9]{54}'''
 keywords = [
     "ezak",
 ]
@@ -365,7 +365,7 @@ keywords = [
 [[rules]]
 description = "EasyPost test API token"
 id = "easypost-test-api-token"
-regex = '''EZTK(?i)[a-z0-9]{54}'''
+regex = '''\bEZTK(?i)[a-z0-9]{54}'''
 keywords = [
     "eztk",
 ]