mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 12:44:22 +01:00
fix(hashicorp): ignore common fps (#1498)
Based on discussion in https://github.com/gitleaks/gitleaks/issues/1490
This commit is contained in:
1 parent
8510d39ffe
commit
75dd70e59a
2 files changed
+18
-1
No files matched your search
@@ -4,6 +4,7 @@ import (
|
|||||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
|
"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"
|
||||||
|
"regexp"
|
||||||
)
|
)
|
||||||
|
|
||||||
func VaultServiceToken() *config.Rule {
|
func VaultServiceToken() *config.Rule {
|
||||||
@@ -14,6 +15,12 @@ func VaultServiceToken() *config.Rule {
|
|||||||
Regex: utils.GenerateUniqueTokenRegex(`(?:hvs\.[\w-]{90,120}|s\.(?i:[a-z0-9]{24}))`, false),
|
Regex: utils.GenerateUniqueTokenRegex(`(?:hvs\.[\w-]{90,120}|s\.(?i:[a-z0-9]{24}))`, false),
|
||||||
Entropy: 3.5,
|
Entropy: 3.5,
|
||||||
Keywords: []string{"hvs", "s."},
|
Keywords: []string{"hvs", "s."},
|
||||||
|
Allowlist: config.Allowlist{
|
||||||
|
Regexes: []*regexp.Regexp{
|
||||||
|
// https://github.com/gitleaks/gitleaks/issues/1490#issuecomment-2334166357
|
||||||
|
regexp.MustCompile(`s\.[A-Za-z]{24}`),
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate
|
// validate
|
||||||
@@ -29,7 +36,11 @@ func VaultServiceToken() *config.Rule {
|
|||||||
// Old
|
// Old
|
||||||
` credentials: new AWS.SharedIniFileCredentials({ profile: '<YOUR_PROFILE>' })`, // word boundary start
|
` credentials: new AWS.SharedIniFileCredentials({ profile: '<YOUR_PROFILE>' })`, // word boundary start
|
||||||
`INFO 4 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean`, // word boundary end
|
`INFO 4 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean`, // word boundary end
|
||||||
`s.xxxxxxxxxxxxxxxxxxxxxxxx`, // low entropy
|
`s.xxxxxxxxxxxxxxxxxxxxxxxx`, // low entropy
|
||||||
|
`s.THISSTRINGISALLUPPERCASE`, // uppercase
|
||||||
|
`s.thisstringisalllowercase`, // lowercase
|
||||||
|
`s.AcceptanceTimeoutSeconds `, // pascal-case
|
||||||
|
`s.makeKubeConfigController = args`, // camel-case
|
||||||
// New
|
// New
|
||||||
`hvs.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`, // low entropy
|
`hvs.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`, // low entropy
|
||||||
}
|
}
|
||||||
@@ -2903,6 +2903,12 @@ keywords = [
|
|||||||
"hvs","s.",
|
"hvs","s.",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[rules.allowlist]
|
||||||
|
|
||||||
|
regexes = [
|
||||||
|
'''s\.[A-Za-z]{24}''',
|
||||||
|
]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
id = "yandex-access-token"
|
id = "yandex-access-token"
|
||||||
description = "Found a Yandex Access Token, posing a risk to Yandex service integrations and user data privacy."
|
description = "Found a Yandex Access Token, posing a risk to Yandex service integrations and user data privacy."
|
||||||
|
|||||||
Reference in new issue
Block a user