mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
Make private key check less greedy and include fifth dash (#1440)
* Make private key check less greedy and include fifth dash * Remove trailing space
This commit is contained in:
1 parent
9c354f51c3
commit
bf8a49fc29
2 files changed
+2
-2
No files matched your search
@@ -12,7 +12,7 @@ func PrivateKey() *config.Rule {
|
|||||||
r := config.Rule{
|
r := config.Rule{
|
||||||
Description: "Identified a Private Key, which may compromise cryptographic security and sensitive data encryption.",
|
Description: "Identified a Private Key, which may compromise cryptographic security and sensitive data encryption.",
|
||||||
RuleID: "private-key",
|
RuleID: "private-key",
|
||||||
Regex: regexp.MustCompile(`(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\s\S-]*KEY(?: BLOCK)?----`),
|
Regex: regexp.MustCompile(`(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\s\S-]*?KEY(?: BLOCK)?-----`),
|
||||||
Keywords: []string{"-----BEGIN"},
|
Keywords: []string{"-----BEGIN"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2544,7 +2544,7 @@ keywords = [
|
|||||||
[[rules]]
|
[[rules]]
|
||||||
id = "private-key"
|
id = "private-key"
|
||||||
description = "Identified a Private Key, which may compromise cryptographic security and sensitive data encryption."
|
description = "Identified a Private Key, which may compromise cryptographic security and sensitive data encryption."
|
||||||
regex = '''(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\s\S-]*KEY(?: BLOCK)?----'''
|
regex = '''(?i)-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\s\S-]*?KEY(?: BLOCK)?-----'''
|
||||||
keywords = [
|
keywords = [
|
||||||
"-----begin",
|
"-----begin",
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in new issue
Block a user