mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 20:24:22 +01:00
* Enhance secret descriptions in gitleaks.toml * adjust the rule configuration descriptions * missing spaces in gitleaks.toml
25 lines
647 B
Go
25 lines
647 B
Go
package rules
|
|
|
|
import (
|
|
"regexp"
|
|
|
|
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
|
"github.com/zricethezav/gitleaks/v8/config"
|
|
)
|
|
|
|
func Duffel() *config.Rule {
|
|
// define rule
|
|
r := config.Rule{
|
|
RuleID: "duffel-api-token",
|
|
Description: "Uncovered a Duffel API token, which may compromise travel platform integrations and sensitive customer data.",
|
|
Regex: regexp.MustCompile(`duffel_(test|live)_(?i)[a-z0-9_\-=]{43}`),
|
|
Keywords: []string{"duffel"},
|
|
}
|
|
|
|
// validate
|
|
tps := []string{
|
|
generateSampleSecret("duffel", "duffel_test_"+secrets.NewSecret(alphaNumericExtended("43"))),
|
|
}
|
|
return validate(r, tps, nil)
|
|
}
|