From 7701eb77775612876bbdb9ddbeed03ff0e6dcbc0 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Mon, 2 Dec 2024 13:35:24 +0100 Subject: [PATCH] add word boundary to regex Co-authored-by: Ben-grmbl <173737458+Ben-grmbl@users.noreply.github.com> --- cmd/generate/config/rules/gitlab.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/generate/config/rules/gitlab.go b/cmd/generate/config/rules/gitlab.go index 629cf247..2af8d02a 100644 --- a/cmd/generate/config/rules/gitlab.go +++ b/cmd/generate/config/rules/gitlab.go @@ -119,7 +119,7 @@ func GitlabPatRoutable() *config.Rule { r := config.Rule{ RuleID: "gitlab-pat-routable", Description: "Identified a GitLab Personal Access Token (routable), risking unauthorized access to GitLab repositories and codebase exposure.", - Regex: regexp.MustCompile(`glpat-[0-9a-zA-Z_-]{27,300}\.[0-9a-z]{2}[0-9a-z]{7}`), + Regex: regexp.MustCompile(`\bglpat-[0-9a-zA-Z_-]{27,300}\.[0-9a-z]{2}[0-9a-z]{7}\b`), Entropy: 4, Keywords: []string{"glpat-"}, }