Files
gitleaks/cmd/generate/config/rules
Becojo 7dc9ba40a7 Add detection for OpenAI API keys (#1148)
* Add detection for OpenAI API keys

* Remove `sk-` keyword
2023-06-14 09:02:37 -05:00
..
2022-04-21 08:31:58 -05:00
2022-04-21 08:31:58 -05:00
2023-06-13 16:05:04 -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
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-04-21 08:31:58 -05:00
2022-04-21 08:31:58 -05:00
2022-06-20 14:57:48 -05:00
2022-04-21 08:31:58 -05:00
2022-08-19 10:43:01 -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
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-08-19 08:24:15 -05:00
2022-04-21 08:31:58 -05:00
2022-04-21 08:31:58 -05:00
2022-08-19 08:24:15 -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
2022-08-03 07:31:40 -05:00
2022-08-03 07:31:40 -05:00
2022-06-28 06:10:02 -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-08-03 15:46:46 -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}`),
		SecretGroup: 1,
		Keywords: []string{
			"rdme_",
		},
	}

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