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