infracost.go 821 B

1234567891011121314151617181920212223242526272829303132
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. func InfracostAPIToken() *config.Rule {
  7. // define rule
  8. r := config.Rule{
  9. // Human readable description of the rule
  10. Description: "Infracost API Token",
  11. // Unique ID for the rule
  12. RuleID: "infracost-api-token",
  13. // Regex capture group for the actual secret
  14. SecretGroup: 1,
  15. // Regex used for detecting secrets. See regex section below for more details
  16. Regex: generateUniqueTokenRegex(`ico-[a-zA-Z0-9]{32}`, true),
  17. // Keywords used for string matching on fragments (think of this as a prefilter)
  18. Keywords: []string{"ico-"},
  19. }
  20. // validate
  21. tps := []string{
  22. generateSampleSecret("ico", "ico-"+secrets.NewSecret("[A-Za-z0-9]{32}")),
  23. }
  24. return validate(r, tps, nil)
  25. }