dynatrace.go 787 B

1234567891011121314151617181920212223242526
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
  4. "regexp"
  5. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  6. "github.com/zricethezav/gitleaks/v8/config"
  7. )
  8. func Dynatrace() *config.Rule {
  9. // define rule
  10. r := config.Rule{
  11. RuleID: "dynatrace-api-token",
  12. Description: "Detected a Dynatrace API token, potentially risking application performance monitoring and data exposure.",
  13. Regex: regexp.MustCompile(`dt0c01\.(?i)[a-z0-9]{24}\.[a-z0-9]{64}`),
  14. Entropy: 4,
  15. Keywords: []string{"dt0c01"},
  16. }
  17. // validate
  18. tps := []string{
  19. utils.GenerateSampleSecret("dynatrace", "dt0c01."+secrets.NewSecret(utils.AlphaNumeric("24"))+"."+secrets.NewSecret(utils.AlphaNumeric("64"))),
  20. }
  21. return utils.Validate(r, tps, nil)
  22. }