codecov.go 670 B

123456789101112131415161718192021222324
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. func CodecovAccessToken() *config.Rule {
  7. // define rule
  8. r := config.Rule{
  9. RuleID: "codecov-access-token",
  10. Description: "Found a pattern resembling a Codecov Access Token, posing a risk of unauthorized access to code coverage reports and sensitive data.",
  11. Regex: generateSemiGenericRegex([]string{"codecov"}, alphaNumeric("32"), true),
  12. Keywords: []string{
  13. "codecov",
  14. },
  15. }
  16. // validate
  17. tps := []string{
  18. generateSampleSecret("codecov", secrets.NewSecret(alphaNumeric("32"))),
  19. }
  20. return validate(r, tps, nil)
  21. }