asana.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 := []string{
  17. utils.GenerateSampleSecret("asana", secrets.NewSecret(utils.Numeric("16"))),
  18. }
  19. return utils.Validate(r, tps, nil)
  20. }
  21. func AsanaClientSecret() *config.Rule {
  22. // define rule
  23. r := config.Rule{
  24. Description: "Identified an Asana Client Secret, which could lead to compromised project management integrity and unauthorized access.",
  25. RuleID: "asana-client-secret",
  26. Regex: utils.GenerateSemiGenericRegex([]string{"asana"}, utils.AlphaNumeric("32"), true),
  27. Keywords: []string{"asana"},
  28. }
  29. // validate
  30. tps := []string{
  31. utils.GenerateSampleSecret("asana", secrets.NewSecret(utils.AlphaNumeric("32"))),
  32. }
  33. return utils.Validate(r, tps, nil)
  34. }