aws.go 547 B

12345678910111213141516171819202122232425262728293031
  1. package rules
  2. import (
  3. "regexp"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. func AWS() *config.Rule {
  7. // define rule
  8. r := config.Rule{
  9. Description: "AWS",
  10. RuleID: "aws-access-token",
  11. Regex: regexp.MustCompile(
  12. "(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}"),
  13. Keywords: []string{
  14. "AKIA",
  15. "AGPA",
  16. "AIDA",
  17. "AROA",
  18. "AIPA",
  19. "ANPA",
  20. "ANVA",
  21. "ASIA",
  22. },
  23. }
  24. // validate
  25. tps := []string{"AWSToken := \"" + "AKIALALEMEL33243OLIB" + "\""} // gitleaks:allow
  26. return validate(r, tps)
  27. }