codecov.go 749 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. )
  7. func CodecovAccessToken() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. RuleID: "codecov-access-token",
  11. Description: "Found a pattern resembling a Codecov Access Token, posing a risk of unauthorized access to code coverage reports and sensitive data.",
  12. Regex: utils.GenerateSemiGenericRegex([]string{"codecov"}, utils.AlphaNumeric("32"), true),
  13. Keywords: []string{
  14. "codecov",
  15. },
  16. }
  17. // validate
  18. tps := utils.GenerateSampleSecrets("codecov", secrets.NewSecret(utils.AlphaNumeric("32")))
  19. return utils.Validate(r, tps, nil)
  20. }