confluent.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. func ConfluentSecretKey() *config.Rule {
  7. // define rule
  8. r := config.Rule{
  9. RuleID: "confluent-secret-key",
  10. Description: "Found a Confluent Secret Key, potentially risking unauthorized operations and data access within Confluent services.",
  11. Regex: generateSemiGenericRegex([]string{"confluent"}, alphaNumeric("64"), true),
  12. Keywords: []string{
  13. "confluent",
  14. },
  15. }
  16. // validate
  17. tps := []string{
  18. generateSampleSecret("confluent", secrets.NewSecret(alphaNumeric("64"))),
  19. }
  20. return validate(r, tps, nil)
  21. }
  22. func ConfluentAccessToken() *config.Rule {
  23. // define rule
  24. r := config.Rule{
  25. RuleID: "confluent-access-token",
  26. Description: "Identified a Confluent Access Token, which could compromise access to streaming data platforms and sensitive data flow.",
  27. Regex: generateSemiGenericRegex([]string{"confluent"}, alphaNumeric("16"), true),
  28. Keywords: []string{
  29. "confluent",
  30. },
  31. }
  32. // validate
  33. tps := []string{
  34. generateSampleSecret("confluent", secrets.NewSecret(alphaNumeric("16"))),
  35. }
  36. return validate(r, tps, nil)
  37. }