mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 20:24:22 +01:00
* Enhance secret descriptions in gitleaks.toml * adjust the rule configuration descriptions * missing spaces in gitleaks.toml
39 lines
1.0 KiB
Go
39 lines
1.0 KiB
Go
package rules
|
|
|
|
import (
|
|
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
|
"github.com/zricethezav/gitleaks/v8/config"
|
|
)
|
|
|
|
func SquareAccessToken() *config.Rule {
|
|
// define rule
|
|
r := config.Rule{
|
|
RuleID: "square-access-token",
|
|
Description: "Detected a Square Access Token, risking unauthorized payment processing and financial transaction exposure.",
|
|
Regex: generateUniqueTokenRegex(`sq0atp-[0-9A-Za-z\-_]{22}`, true),
|
|
Keywords: []string{"sq0atp-"},
|
|
}
|
|
|
|
// validate
|
|
tps := []string{
|
|
generateSampleSecret("square", secrets.NewSecret(`sq0atp-[0-9A-Za-z\-_]{22}`)),
|
|
}
|
|
return validate(r, tps, nil)
|
|
}
|
|
|
|
func SquareSecret() *config.Rule {
|
|
// define rule
|
|
r := config.Rule{
|
|
RuleID: "square-secret",
|
|
Description: "Square Secret",
|
|
Regex: generateUniqueTokenRegex(`sq0csp-[0-9A-Za-z\\-_]{43}`, true),
|
|
Keywords: []string{"sq0csp-"},
|
|
}
|
|
|
|
// validate
|
|
tps := []string{
|
|
generateSampleSecret("square", secrets.NewSecret(`sq0csp-[0-9A-Za-z\\-_]{43}`)),
|
|
}
|
|
return validate(r, tps, nil)
|
|
}
|