Files
gitleaks/cmd/generate/config/rules
Kieran Smith 76c9e3175b Remove IAM identifiers for non-credential resources in the aws-access-token rule (#1307)
* Remove IAM identifiers for non-credential resources

Only detects: 
AWS STS service bearer token
Context-specific credential
Access key
Temporary (AWS STS) access key IDs use this prefix, but are unique only in combination with the secret access key and the session token.

* Update gitleaks.toml

* Update testdata

* Update tests
2024-01-31 13:21:53 -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
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
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-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)
}