Files
gitleaks/cmd/generate/config/rules
..
2022-04-21 08:31:58 -05:00
2022-04-21 08:31:58 -05:00
2022-04-21 08:31:58 -05:00
2022-04-21 08:31:58 -05:00
2022-04-21 08:31:58 -05:00
2022-04-21 08:31:58 -05:00
2023-03-14 11:06:17 -05:00
2022-06-20 14:57:48 -05:00
2022-04-21 08:31:58 -05:00
2022-04-21 08:31:58 -05:00
2023-10-08 20:44:02 -05:00
2022-04-21 08:31:58 -05:00
2022-04-21 08:31:58 -05:00
2023-10-23 14:11:37 -05:00
2022-04-21 08:31:58 -05:00

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}`, true),
		SecretGroup: 1,
		Keywords: []string{
			"rdme_",
		},
	}

	// validate
	tps := []string{
		generateSampleSecret("api-token", "rdme_"+secrets.NewSecret(alphaNumeric("70"))),
	}
	return validate(r, tps, nil)
}