mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 21:24:21 +01:00
1 parent
d8cd93cabe
commit
3474c58c9e
58 files changed
+264
-337
No files matched your search
@@ -3,10 +3,8 @@ package rules
|
||||
import (
|
||||
"regexp"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
"github.com/zricethezav/gitleaks/v8/detect"
|
||||
)
|
||||
|
||||
func Twilio() *config.Rule {
|
||||
@@ -20,15 +18,7 @@ func Twilio() *config.Rule {
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
"twilioAPIKey := \"SK" + sampleHex32Token + "\"",
|
||||
"twilioAPIKey := \"SK" + secrets.NewSecret(hex("32")) + "\"",
|
||||
}
|
||||
d := detect.NewDetector(config.Config{
|
||||
Rules: []*config.Rule{&r},
|
||||
})
|
||||
for _, tp := range tps {
|
||||
if len(d.DetectString(tp)) != 1 {
|
||||
log.Fatal().Msg("Failed to validate twilio")
|
||||
}
|
||||
}
|
||||
return &r
|
||||
return validate(r, tps)
|
||||
}
|
||||
Reference in new issue
Block a user