mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 12:14:22 +01:00
* Enhance secret descriptions in gitleaks.toml * adjust the rule configuration descriptions * missing spaces in gitleaks.toml
40 lines
1.2 KiB
Go
40 lines
1.2 KiB
Go
package rules
|
|
|
|
import (
|
|
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
|
"github.com/zricethezav/gitleaks/v8/config"
|
|
)
|
|
|
|
func BitBucketClientID() *config.Rule {
|
|
// define rule
|
|
r := config.Rule{
|
|
Description: "Discovered a potential Bitbucket Client ID, risking unauthorized repository access and potential codebase exposure.",
|
|
RuleID: "bitbucket-client-id",
|
|
Regex: generateSemiGenericRegex([]string{"bitbucket"}, alphaNumeric("32"), true),
|
|
Keywords: []string{"bitbucket"},
|
|
}
|
|
|
|
// validate
|
|
tps := []string{
|
|
generateSampleSecret("bitbucket", secrets.NewSecret(alphaNumeric("32"))),
|
|
}
|
|
return validate(r, tps, nil)
|
|
}
|
|
|
|
func BitBucketClientSecret() *config.Rule {
|
|
// define rule
|
|
r := config.Rule{
|
|
Description: "Discovered a potential Bitbucket Client Secret, posing a risk of compromised code repositories and unauthorized access.",
|
|
RuleID: "bitbucket-client-secret",
|
|
Regex: generateSemiGenericRegex([]string{"bitbucket"}, alphaNumericExtended("64"), true),
|
|
|
|
Keywords: []string{"bitbucket"},
|
|
}
|
|
|
|
// validate
|
|
tps := []string{
|
|
generateSampleSecret("bitbucket", secrets.NewSecret(alphaNumeric("64"))),
|
|
}
|
|
return validate(r, tps, nil)
|
|
}
|