Files
gitleaks/cmd/generate/config/rules
Dewan Ishtiaque AhmedandZachary Rice b899915813 Add harness PAT and SAT rules (#1406)
* Add Harness PAT rule.

* Add support for Harness PAT and SAT.

* Update comment for Harness SAT.

* Consolidate PAT and SAT into Harness API Key

* add ignore and capture group to match

---------

Co-authored-by: Zachary Rice <zachary.rice@trufflesec.com>
2024-06-14 15:30:07 -04:00
..
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
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
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
2024-06-13 11:14:44 -04: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)
}