mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-01 13:34:23 +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,10 +11,10 @@ func LinkedinClientSecret() *config.Rule {
|
||||
r := config.Rule{
|
||||
RuleID: "linkedin-client-secret",
|
||||
Description: "Discovered a LinkedIn Client secret, potentially compromising LinkedIn application integrations and user data.",
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
Regex: utils.GenerateSemiGenericRegex([]string{
|
||||
"linkedin",
|
||||
"linked-in",
|
||||
}, alphaNumeric("16"), true),
|
||||
}, utils.AlphaNumeric("16"), true),
|
||||
|
||||
Keywords: []string{
|
||||
"linkedin",
|
||||
@@ -23,9 +24,9 @@ func LinkedinClientSecret() *config.Rule {
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("linkedin", secrets.NewSecret(alphaNumeric("16"))),
|
||||
utils.GenerateSampleSecret("linkedin", secrets.NewSecret(utils.AlphaNumeric("16"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
return utils.Validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func LinkedinClientID() *config.Rule {
|
||||
@@ -33,10 +34,10 @@ func LinkedinClientID() *config.Rule {
|
||||
r := config.Rule{
|
||||
RuleID: "linkedin-client-id",
|
||||
Description: "Found a LinkedIn Client ID, risking unauthorized access to LinkedIn integrations and professional data exposure.",
|
||||
Regex: generateSemiGenericRegex([]string{
|
||||
Regex: utils.GenerateSemiGenericRegex([]string{
|
||||
"linkedin",
|
||||
"linked-in",
|
||||
}, alphaNumeric("14"), true),
|
||||
}, utils.AlphaNumeric("14"), true),
|
||||
|
||||
Keywords: []string{
|
||||
"linkedin",
|
||||
@@ -46,7 +47,7 @@ func LinkedinClientID() *config.Rule {
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("linkedin", secrets.NewSecret(alphaNumeric("14"))),
|
||||
utils.GenerateSampleSecret("linkedin", secrets.NewSecret(utils.AlphaNumeric("14"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
return utils.Validate(r, tps, nil)
|
||||
}
|
||||
Reference in new issue
Block a user