fastly.go 741 B

12345678910111213141516171819202122
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
  4. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  5. "github.com/zricethezav/gitleaks/v8/config"
  6. )
  7. func FastlyAPIToken() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. Description: "Uncovered a Fastly API key, which may compromise CDN and edge cloud services, leading to content delivery and security issues.",
  11. RuleID: "fastly-api-token",
  12. Regex: utils.GenerateSemiGenericRegex([]string{"fastly"}, utils.AlphaNumericExtended("32"), true),
  13. Keywords: []string{"fastly"},
  14. }
  15. // validate
  16. tps := utils.GenerateSampleSecrets("fastly", secrets.NewSecret(utils.AlphaNumericExtended("32")))
  17. return utils.Validate(r, tps, nil)
  18. }