diff --git a/cmd/generate/config/rules/privatekey.go b/cmd/generate/config/rules/privatekey.go index 3897fb9e..9ca2a995 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-----[\s\S-]*KEY----`), + Regex: regexp.MustCompile(`(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\s\S-]*KEY----`), Keywords: []string{"-----BEGIN"}, } diff --git a/config/gitleaks.toml b/config/gitleaks.toml index c8af8fa1..3e1b17bc 100644 --- a/config/gitleaks.toml +++ b/config/gitleaks.toml @@ -2365,7 +2365,7 @@ keywords = [ [[rules]] description = "Private Key" id = "private-key" -regex = '''(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY-----[\s\S-]*KEY----''' +regex = '''(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY( BLOCK)?-----[\s\S-]*KEY----''' keywords = [ "-----begin", ]