confluent.go 1.3 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 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 := utils.GenerateSampleSecrets("confluent", secrets.NewSecret(utils.AlphaNumeric("64")))
  19. return utils.Validate(r, tps, nil)
  20. }
  21. func ConfluentAccessToken() *config.Rule {
  22. // define rule
  23. r := config.Rule{
  24. RuleID: "confluent-access-token",
  25. Description: "Identified a Confluent Access Token, which could compromise access to streaming data platforms and sensitive data flow.",
  26. Regex: utils.GenerateSemiGenericRegex([]string{"confluent"}, utils.AlphaNumeric("16"), true),
  27. Keywords: []string{
  28. "confluent",
  29. },
  30. }
  31. // validate
  32. tps := utils.GenerateSampleSecrets("confluent", secrets.NewSecret(utils.AlphaNumeric("16")))
  33. return utils.Validate(r, tps, nil)
  34. }