PlanetScalePassword (rules/planetscale.go)

gitleaks · cmd/generate/config/rules/planetscale.go · go · MIT
database, Database / ORM

Defines Gitleaks rules for detecting PlanetScale credentials.

// Source: https://github.com/gitleaks/gitleaks | License: MIT | Copyright 2019 Zachary Rice
// Provided via justclaw.it.com; keep this notice with the code.
package rules

import (
	"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
	"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
	"github.com/zricethezav/gitleaks/v8/config"
)

func PlanetScalePassword() *config.Rule {
	// define rule
	r := config.Rule{
		RuleID:      "planetscale-password",
		Description: "Discovered a PlanetScale password, which could lead to unauthorized database operations and data breaches.",
		Regex:       utils.GenerateUniqueTokenRegex(`pscale_pw_(?i)[\w=\.-]{32,64}`, true),
		Entropy:     3,
		Keywords: []string{
			"pscale_pw_",
		},
	}

	// validate
	tps := utils.GenerateSampleSecrets("plan

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key