doppler.go 823 B

1234567891011121314151617181920212223242526
  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 Doppler() *config.Rule {
  9. // define rule
  10. r := config.Rule{
  11. RuleID: "doppler-api-token",
  12. Description: "Discovered a Doppler API token, posing a risk to environment and secrets management security.",
  13. Regex: regexp.MustCompile(`dp\.pt\.(?i)[a-z0-9]{43}`),
  14. Entropy: 2,
  15. Keywords: []string{`dp.pt.`},
  16. }
  17. // validate
  18. tps := utils.GenerateSampleSecrets("doppler", "dp.pt."+secrets.NewSecret(utils.AlphaNumeric("43")))
  19. return utils.Validate(r, tps, nil)
  20. }
  21. // TODO add additional doppler formats:
  22. // https://docs.doppler.com/reference/auth-token-formats