mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-01 05:24:22 +01:00
Make config generation utils public (#1480)
* chore(generate): make utils public * chore(generate): change validate log messages * chore(generate): split functions into files * chore(config): add warning for public funcs
This commit is contained in:
1 parent
3be7faa1ff
commit
bd81872eee
114 files changed
+862
-713
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
@@ -10,8 +11,8 @@ func NetlifyAccessToken() *config.Rule {
|
||||
r := config.Rule{
|
||||
RuleID: "netlify-access-token",
|
||||
Description: "Detected a Netlify Access Token, potentially compromising web hosting services and site management.",
|
||||
Regex: generateSemiGenericRegex([]string{"netlify"},
|
||||
alphaNumericExtended("40,46"), true),
|
||||
Regex: utils.GenerateSemiGenericRegex([]string{"netlify"},
|
||||
utils.AlphaNumericExtended("40,46"), true),
|
||||
|
||||
Keywords: []string{
|
||||
"netlify",
|
||||
@@ -20,7 +21,7 @@ func NetlifyAccessToken() *config.Rule {
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("netlify", secrets.NewSecret(alphaNumericExtended("40,46"))),
|
||||
utils.GenerateSampleSecret("netlify", secrets.NewSecret(utils.AlphaNumericExtended("40,46"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
return utils.Validate(r, tps, nil)
|
||||
}
|
||||
Reference in new issue
Block a user