clojars.go 757 B

1234567891011121314151617181920212223
  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. "github.com/zricethezav/gitleaks/v8/regexp"
  7. )
  8. func Clojars() *config.Rule {
  9. // define rule
  10. r := config.Rule{
  11. RuleID: "clojars-api-token",
  12. Description: "Uncovered a possible Clojars API token, risking unauthorized access to Clojure libraries and potential code manipulation.",
  13. Regex: regexp.MustCompile(`(?i)CLOJARS_[a-z0-9]{60}`),
  14. Entropy: 2,
  15. Keywords: []string{"clojars_"},
  16. }
  17. // validate
  18. tps := utils.GenerateSampleSecrets("clojars", "CLOJARS_"+secrets.NewSecret(utils.AlphaNumeric("60")))
  19. return utils.Validate(r, tps, nil)
  20. }