gcp.go 516 B

123456789101112131415161718192021222324
  1. package rules
  2. import (
  3. "regexp"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. // TODO this one could probably use some work
  7. func GCPServiceAccount() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. Description: "Google (GCP) Service-account",
  11. RuleID: "gcp-service-account",
  12. Regex: regexp.MustCompile(`\"type\": \"service_account\"`),
  13. Keywords: []string{`\"type\": \"service_account\"`},
  14. }
  15. // validate
  16. tps := []string{
  17. `"type": "service_account"`,
  18. }
  19. return validate(r, tps, nil)
  20. }