mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 20:24:22 +01:00
* Add sidekiq rules * Added two new rules for sidekiq * Other: Add keywords to square rules per Zach's instructions * Validate now works, but test suite is failing * Tests are now passing * Add Sidekiq Rules: Ran go fmt * * After resolving conflicts, had to rerun the rule generator to add back the semicolon char * After running tests, had to fix one line in testdata/expected/report/sarif_simple.sarif * * Added keywords to simple.toml for sidekiq-sensitive-url so that the rule matches what is in gitleaks.toml Co-authored-by: Andrew Weiner <aweiner@frontrush.com>
39 lines
935 B
Go
39 lines
935 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}`),
|
|
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}`),
|
|
Keywords: []string{"sq0csp-"},
|
|
}
|
|
|
|
// validate
|
|
tps := []string{
|
|
generateSampleSecret("square", secrets.NewSecret(`sq0csp-[0-9A-Za-z\\-_]{43}`)),
|
|
}
|
|
return validate(r, tps, nil)
|
|
}
|