heroku.go 874 B

1234567891011121314151617181920212223242526
  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 Heroku() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. Description: "Detected a Heroku API Key, potentially compromising cloud application deployments and operational security.",
  11. RuleID: "heroku-api-key",
  12. Regex: utils.GenerateSemiGenericRegex([]string{"heroku"}, utils.Hex8_4_4_4_12(), true),
  13. Keywords: []string{"heroku"},
  14. }
  15. // validate
  16. tps := utils.GenerateSampleSecrets("heroku", secrets.NewSecret(utils.Hex8_4_4_4_12()))
  17. tps = append(tps,
  18. `const HEROKU_KEY = "12345678-ABCD-ABCD-ABCD-1234567890AB"`, // gitleaks:allow
  19. `heroku_api_key = "832d2129-a846-4e27-99f4-7004b6ad53ef"`, // gitleaks:allow
  20. )
  21. return utils.Validate(r, tps, nil)
  22. }