heroku.go 726 B

123456789101112131415161718192021222324
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. func Heroku() *config.Rule {
  7. // define rule
  8. r := config.Rule{
  9. Description: "Detected a Heroku API Key, potentially compromising cloud application deployments and operational security.",
  10. RuleID: "heroku-api-key",
  11. Regex: utils.GenerateSemiGenericRegex([]string{"heroku"}, utils.Hex8_4_4_4_12(), true),
  12. Keywords: []string{"heroku"},
  13. }
  14. // validate
  15. tps := []string{
  16. `const HEROKU_KEY = "12345678-ABCD-ABCD-ABCD-1234567890AB"`, // gitleaks:allow
  17. `heroku_api_key = "832d2129-a846-4e27-99f4-7004b6ad53ef"`, // gitleaks:allow
  18. }
  19. return utils.Validate(r, tps, nil)
  20. }