confluent.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 ConfluentSecretKey() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. RuleID: "confluent-secret-key",
  11. Description: "Found a Confluent Secret Key, potentially risking unauthorized operations and data access within Confluent services.",
  12. Regex: utils.GenerateSemiGenericRegex([]string{"confluent"}, utils.AlphaNumeric("64"), true),
  13. Keywords: []string{
  14. "confluent",
  15. },
  16. }
  17. // validate
  18. tps := []string{
  19. utils.GenerateSampleSecret("confluent", secrets.NewSecret(utils.AlphaNumeric("64"))),
  20. }
  21. return utils.Validate(r, tps, nil)
  22. }
  23. func ConfluentAccessToken() *config.Rule {
  24. // define rule
  25. r := config.Rule{
  26. RuleID: "confluent-access-token",
  27. Description: "Identified a Confluent Access Token, which could compromise access to streaming data platforms and sensitive data flow.",
  28. Regex: utils.GenerateSemiGenericRegex([]string{"confluent"}, utils.AlphaNumeric("16"), true),
  29. Keywords: []string{
  30. "confluent",
  31. },
  32. }
  33. // validate
  34. tps := []string{
  35. utils.GenerateSampleSecret("confluent", secrets.NewSecret(utils.AlphaNumeric("16"))),
  36. }
  37. return utils.Validate(r, tps, nil)
  38. }