mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
Standardize/alphabetize rules, add cmd/generate/config package (#840)
This commit is contained in:
1 parent
e784980515
commit
606bb1a13b
62 files changed
+2959
-642
No files matched your search
@@ -0,0 +1,22 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func MapBox() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "MapBox API token",
|
||||
RuleID: "mapbox-api-token",
|
||||
Regex: generateSemiGenericRegex([]string{"mapbox"}, `pk\.[a-z0-9]{60}\.[a-z0-9]{22}`),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{"mapbox"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("mapbox", "pk."+sampleAlphaNumeric60Token+"."+sampleAlphaNumeric22Token),
|
||||
}
|
||||
return validate(r, tps)
|
||||
}
|
||||
Reference in new issue
Block a user