hubspot.go 830 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 HubSpot() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. Description: "Found a HubSpot API Token, posing a risk to CRM data integrity and unauthorized marketing operations.",
  11. RuleID: "hubspot-api-key",
  12. Regex: utils.GenerateSemiGenericRegex([]string{"hubspot"},
  13. `[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}`, true),
  14. Keywords: []string{"hubspot"},
  15. }
  16. // validate
  17. tps := utils.GenerateSampleSecrets("hubspot", secrets.NewSecret(utils.Hex8_4_4_4_12()))
  18. tps = append(tps,
  19. `const hubspotKey = "12345678-ABCD-ABCD-ABCD-1234567890AB"`, // gitleaks:allow
  20. )
  21. return utils.Validate(r, tps, nil)
  22. }