Standardize/alphabetize rules, add cmd/generate/config package (#840)

This commit is contained in:
Zachary Rice authored and GitHub committed 2022-04-12 21:40:48 -05:00
1 parent e784980515
commit 606bb1a13b
62 files changed
+2959 -642

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
package rules
import (
"github.com/zricethezav/gitleaks/v8/config"
)
func SendGridAPIToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "sendgrid-api-token",
Description: "SendGrid API token",
Regex: generateUniqueTokenRegex(`SG\.(?i)[a-z0-9=_\-\.]{66}`),
SecretGroup: 1,
Keywords: []string{
"SG.",
},
}
// validate
tps := []string{
generateSampleSecret("sengridAPIToken", "SG."+sampleExtendedAlphaNumeric66Token),
}
return validate(r, tps)
}