mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
Limit newlines regex (#881)
* improve regex to reduce fps with newlines * remove version from regex and rely on stopwords instead * add false positive for validation
This commit is contained in:
1 parent
0eb57cbe4d
commit
82e409a434
3 files changed
+48
-45
No files matched your search
@@ -11,7 +11,7 @@ func GenericCredential() *config.Rule {
|
||||
Description: "Generic API Key",
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
"key",
|
||||
"api[^Version]",
|
||||
"api",
|
||||
"token",
|
||||
"secret",
|
||||
"client",
|
||||
@@ -45,6 +45,9 @@ func GenericCredential() *config.Rule {
|
||||
}
|
||||
fps := []string{
|
||||
`client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.client-vpn-endpoint.id`,
|
||||
`password combination.
|
||||
|
||||
R5: Regulatory--21`,
|
||||
}
|
||||
return validate(r, tps, fps)
|
||||
}
|
||||
@@ -16,7 +16,7 @@ const (
|
||||
|
||||
// identifier prefix (just an ignore group)
|
||||
identifierPrefix = `(?:`
|
||||
identifierSuffix = `)(?:[0-9a-z\-_\s.]{0,20})(?:[\s|']|[\s|"]){0,3}`
|
||||
identifierSuffix = `)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}`
|
||||
|
||||
// commonly used assignment operators or function call
|
||||
operator = `(?:=|>|:=|\|\|:|<=|=>|:)`
|
||||
|
||||
Reference in new issue
Block a user