From 1fb3a77eb81d8b98839560c84ed6e554cf79517b Mon Sep 17 00:00:00 2001 From: wolframhaussig <13997737+wolframhaussig@users.noreply.github.com> Date: Tue, 14 Mar 2023 17:06:17 +0100 Subject: [PATCH] Update gitleaks.toml (#1116) Use Word Boundaries for EasyPost Tokens --- cmd/generate/config/rules/easypost.go | 4 ++-- config/gitleaks.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/generate/config/rules/easypost.go b/cmd/generate/config/rules/easypost.go index b2a3ace0f..c5716d6ae 100644 --- a/cmd/generate/config/rules/easypost.go +++ b/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"}, } diff --git a/config/gitleaks.toml b/config/gitleaks.toml index 25805a2a8..c2a2870bf 100644 --- a/config/gitleaks.toml +++ b/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", ]