scalingo.go 744 B

1234567891011121314151617181920212223
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. func ScalingoAPIToken() *config.Rule {
  7. // define rule
  8. r := config.Rule{
  9. Description: "Found a Scalingo API token, posing a risk to cloud platform services and application deployment security.",
  10. RuleID: "scalingo-api-token",
  11. Regex: generateUniqueTokenRegex(`tk-us-[a-zA-Z0-9-_]{48}`, false),
  12. Keywords: []string{"tk-us-"},
  13. }
  14. // validate
  15. tps := []string{
  16. generateSampleSecret("scalingo", "tk-us-"+secrets.NewSecret(alphaNumericExtendedShort("48"))),
  17. `scalingo_api_token = "tk-us-loys7ib9yrxcys_ta2sq85mjar6lgcsspkd9x61s7h5epf_-"`, // gitleaks:allow
  18. }
  19. return validate(r, tps, nil)
  20. }