aws.go 624 B

123456789101112131415161718192021222324252627
  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: "Identified a pattern that may indicate AWS credentials, risking unauthorized cloud resource access and data breaches on AWS platforms.",
  10. RuleID: "aws-access-token",
  11. Regex: regexp.MustCompile(
  12. "(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z0-9]{16}"),
  13. Keywords: []string{
  14. "AKIA",
  15. "ASIA",
  16. "ABIA",
  17. "ACCA",
  18. },
  19. }
  20. // validate
  21. tps := []string{generateSampleSecret("AWS", "AKIALALEMEL33243OLIB")} // gitleaks:allow
  22. return validate(r, tps, nil)
  23. }