infracost.go 803 B

12345678910111213141516171819202122232425262728293031
  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. // Regex used for detecting secrets. See regex section below for more details
  15. Regex: generateUniqueTokenRegex(`ico-[a-zA-Z0-9]{32}`, true),
  16. // Keywords used for string matching on fragments (think of this as a prefilter)
  17. Keywords: []string{"ico-"},
  18. }
  19. // validate
  20. tps := []string{
  21. generateSampleSecret("ico", "ico-"+secrets.NewSecret("[A-Za-z0-9]{32}")),
  22. }
  23. return validate(r, tps, nil)
  24. }