aws.go 700 B

12345678910111213141516171819202122232425262728
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
  4. "regexp"
  5. "github.com/zricethezav/gitleaks/v8/config"
  6. )
  7. func AWS() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. Description: "Identified a pattern that may indicate AWS credentials, risking unauthorized cloud resource access and data breaches on AWS platforms.",
  11. RuleID: "aws-access-token",
  12. Regex: regexp.MustCompile(
  13. "(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z0-9]{16}"),
  14. Keywords: []string{
  15. "AKIA",
  16. "ASIA",
  17. "ABIA",
  18. "ACCA",
  19. },
  20. }
  21. // validate
  22. tps := []string{utils.GenerateSampleSecret("AWS", "AKIALALEMEL33243OLIB")} // gitleaks:allow
  23. return utils.Validate(r, tps, nil)
  24. }