Update Harness rules to add _ and - in the account ID part. (#1503)

This commit is contained in:
Dewan Ishtiaque Ahmed authored and GitHub committed 2024-09-11 19:48:12 -05:00
1 parent 4e43d11093
commit e93a7c0d26
2 files changed
+4 -3

No files matched your search

+3 -2
View File
@@ -1,9 +1,10 @@
package rules package rules
import ( import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"regexp" "regexp"
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets" "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config" "github.com/zricethezav/gitleaks/v8/config"
) )
@@ -13,7 +14,7 @@ func HarnessApiKey() *config.Rule {
r := config.Rule{ r := config.Rule{
Description: "Identified a Harness Access Token (PAT or SAT), risking unauthorized access to a Harness account.", Description: "Identified a Harness Access Token (PAT or SAT), risking unauthorized access to a Harness account.",
RuleID: "harness-api-key", RuleID: "harness-api-key",
Regex: regexp.MustCompile(`(?:pat|sat)\.[a-zA-Z0-9]{22}\.[a-zA-Z0-9]{24}\.[a-zA-Z0-9]{20}`), Regex: regexp.MustCompile(`(?:pat|sat)\.[a-zA-Z0-9_-]{22}\.[a-zA-Z0-9]{24}\.[a-zA-Z0-9]{20}`),
Keywords: []string{"pat.", "sat."}, Keywords: []string{"pat.", "sat."},
} }
+1 -1
View File
@@ -2098,7 +2098,7 @@ keywords = [
[[rules]] [[rules]]
id = "harness-api-key" id = "harness-api-key"
description = "Identified a Harness Access Token (PAT or SAT), risking unauthorized access to a Harness account." description = "Identified a Harness Access Token (PAT or SAT), risking unauthorized access to a Harness account."
regex = '''(?:pat|sat)\.[a-zA-Z0-9]{22}\.[a-zA-Z0-9]{24}\.[a-zA-Z0-9]{20}''' regex = '''(?:pat|sat)\.[a-zA-Z0-9_-]{22}\.[a-zA-Z0-9]{24}\.[a-zA-Z0-9]{20}'''
keywords = [ keywords = [
"pat.","sat.", "pat.","sat.",
] ]