mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 12:44:22 +01:00
Adds detection support for Defined Networking tokens (https://docs.defined.net/guides/automating-host-creation/) I added a fixture in addition to the generator, I think I may be able to use the `generateUniqueToken` instead of the semi-generic option? Let me know if I should update accordingly. Remove testing fixture
package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func ReadMe() *config.Rule {
// define rule
r := config.Rule{
RuleID: "readme-api-token",
Description: "Readme API token",
Regex: generateUniqueTokenRegex(`rdme_[a-z0-9]{70}`),
SecretGroup: 1,
Keywords: []string{
"rdme_",
},
}
// validate
tps := []string{
generateSampleSecret("api-token", "rdme_"+secrets.NewSecret(alphaNumeric("70"))),
}
return validate(r, tps, nil)
}