mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 20:24:22 +01:00
* Adding a bunch of new rules, update allowlist to include node_modules and vendor folders, extend helper config functions * use func instead of function in stopwords
37 lines
863 B
Go
37 lines
863 B
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: "Square Access Token",
|
|
Regex: generateUniqueTokenRegex(`sq0atp-[0-9A-Za-z\-_]{22}`),
|
|
}
|
|
|
|
// 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}`),
|
|
}
|
|
|
|
// validate
|
|
tps := []string{
|
|
generateSampleSecret("square", secrets.NewSecret(`sq0csp-[0-9A-Za-z\\-_]{43}`)),
|
|
}
|
|
return validate(r, tps, nil)
|
|
}
|