adafruit.go 763 B

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