postman.go 504 B

123456789101112131415161718192021222324
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/config"
  4. )
  5. func PostManAPI() *config.Rule {
  6. // define rule
  7. r := config.Rule{
  8. RuleID: "postman-api-token",
  9. Description: "Postman API token",
  10. Regex: generateUniqueTokenRegex(`PMAK-(?i)[a-f0-9]{24}\-[a-f0-9]{34}`),
  11. SecretGroup: 1,
  12. Keywords: []string{
  13. "PMAK-",
  14. },
  15. }
  16. // validate
  17. tps := []string{
  18. generateSampleSecret("postmanAPItoken", "PMAK-"+sampleHex24Token+"-"+sampleHex34Token),
  19. }
  20. return validate(r, tps)
  21. }