diff --git a/cmd/generate/config/rules/privatekey.go b/cmd/generate/config/rules/privatekey.go index 9ca2a995..15985857 100644 --- a/cmd/generate/config/rules/privatekey.go +++ b/cmd/generate/config/rules/privatekey.go @@ -11,7 +11,7 @@ func PrivateKey() *config.Rule { r := config.Rule{ Description: "Private Key", RuleID: "private-key", - Regex: regexp.MustCompile(`(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\s\S-]*KEY----`), + Regex: regexp.MustCompile(`(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\s\S-]*KEY( BLOCK)?----`), Keywords: []string{"-----BEGIN"}, } @@ -23,6 +23,9 @@ anything abcdefghijklmnopqrstuvwxyz -----END RSA PRIVATE KEY----- `, + `-----BEGIN PRIVATE KEY BLOCK----- +anything +-----END PRIVATE KEY BLOCK-----`, } // gitleaks:allow return validate(r, tps, nil) } diff --git a/config/gitleaks.toml b/config/gitleaks.toml index bd67318c..7a7f00da 100644 --- a/config/gitleaks.toml +++ b/config/gitleaks.toml @@ -2411,7 +2411,7 @@ keywords = [ [[rules]] description = "Private Key" id = "private-key" -regex = '''(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\s\S-]*KEY----''' +regex = '''(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\s\S-]*KEY( BLOCK)?----''' keywords = [ "-----begin", ]