shippo.go 707 B

1234567891011121314151617181920212223242526
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. func ShippoAPIToken() *config.Rule {
  7. // define rule
  8. r := config.Rule{
  9. RuleID: "shippo-api-token",
  10. Description: "Discovered a Shippo API token, potentially compromising shipping services and customer order data.",
  11. Regex: generateUniqueTokenRegex(`shippo_(live|test)_[a-f0-9]{40}`, true),
  12. Keywords: []string{
  13. "shippo_",
  14. },
  15. }
  16. // validate
  17. tps := []string{
  18. generateSampleSecret("shippo", "shippo_live_"+secrets.NewSecret(hex("40"))),
  19. generateSampleSecret("shippo", "shippo_test_"+secrets.NewSecret(hex("40"))),
  20. }
  21. return validate(r, tps, nil)
  22. }