asana.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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 AsanaClientID() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. Description: "Discovered a potential Asana Client ID, risking unauthorized access to Asana projects and sensitive task information.",
  11. RuleID: "asana-client-id",
  12. Regex: utils.GenerateSemiGenericRegex([]string{"asana"}, utils.Numeric("16"), true),
  13. Keywords: []string{"asana"},
  14. }
  15. // validate
  16. tps := utils.GenerateSampleSecrets("asana", secrets.NewSecret(utils.Numeric("16")))
  17. return utils.Validate(r, tps, nil)
  18. }
  19. func AsanaClientSecret() *config.Rule {
  20. // define rule
  21. r := config.Rule{
  22. Description: "Identified an Asana Client Secret, which could lead to compromised project management integrity and unauthorized access.",
  23. RuleID: "asana-client-secret",
  24. Regex: utils.GenerateSemiGenericRegex([]string{"asana"}, utils.AlphaNumeric("32"), true),
  25. Keywords: []string{"asana"},
  26. }
  27. // validate
  28. tps := utils.GenerateSampleSecrets("asana", secrets.NewSecret(utils.AlphaNumeric("32")))
  29. return utils.Validate(r, tps, nil)
  30. }