adafruit.go 684 B

12345678910111213141516171819202122
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  4. "github.com/zricethezav/gitleaks/v8/config"
  5. )
  6. func AdafruitAPIKey() *config.Rule {
  7. // define rule
  8. r := config.Rule{
  9. Description: "Identified a potential Adafruit API Key, which could lead to unauthorized access to Adafruit services and sensitive data exposure.",
  10. RuleID: "adafruit-api-key",
  11. Regex: generateSemiGenericRegex([]string{"adafruit"}, alphaNumericExtendedShort("32"), true),
  12. Keywords: []string{"adafruit"},
  13. }
  14. // validate
  15. tps := []string{
  16. generateSampleSecret("adafruit", secrets.NewSecret(alphaNumericExtendedShort("32"))),
  17. }
  18. return validate(r, tps, nil)
  19. }