Files
gitleaks/cmd/generate/config/rules
..
2023-11-29 17:03:11 -06:00
2024-02-19 09:26:41 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2024-06-01 18:55:04 -05:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2024-03-22 13:31:09 -05:00
2023-11-18 12:28:17 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06:00
2023-11-29 17:03:11 -06: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: "Detected a Readme API token, risking unauthorized documentation management and content exposure.",
		Regex:       generateUniqueTokenRegex(`rdme_[a-z0-9]{70}`, true),

		Keywords: []string{
			"rdme_",
		},
	}

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