4
0

postman.go 658 B

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