rules

package
v0.1.27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2025 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultStopWords = []string{}/* 1477 elements not displayed */
View Source
var EmailDomainStopWords = []string{}
View Source
var UrlDomainStopWords = []string{

	"facebook.com",
	"youtube.com",
	"twitter.com",
	".x.com",

	"olx.com.br",
	"7games.bet",
	"www.google.com",
	"translate.google.com",
	"instagram.com",
	"www.godaddy.com",
	"tiktok.com",
	"www.paypal.com",
	"www.netflix.com",
	"www.roblox.com",
	"www.amazon.com",

	"yandex.ru",
}

Functions

This section is empty.

Types

type Rule

type Rule struct {
	// RuleID is a unique identifier for this rule
	RuleID string

	// Description is the description of the rule.
	Description string

	// Entropy is a float representing the minimum shannon
	// entropy a regex group must have to be considered a secret.
	Entropy float64

	// SecretGroup is an int used to extract secret from regex
	// match and used as the group that will have its entropy
	// checked if `entropy` is set.
	SecretGroup int

	// Regex is a golang regular expression used to detect secrets.
	Regex *regexp.Regexp

	// Path is a golang regular expression used to
	// filter secrets by path
	Path *regexp.Regexp

	// Tags is an array of strings used for metadata
	// and reporting purposes.
	Tags []string

	// Keywords are used for pre-regex check filtering. Rules that contain
	// keywords will perform a quick string compare check to make sure the
	// keyword(s) are in the content being scanned.
	Keywords []string

	CheckGlobalStopWord bool

	PostProcessor func(*models.Finding) (bool, error)
}

Rules contain information that define details on how to detect secrets

func Email

func Email() *Rule

func Leak1

func Leak1() *Rule

func Leak2

func Leak2() *Rule

func Leak3 added in v0.1.13

func Leak3() *Rule

func Url

func Url() *Rule

func (Rule) Validate

func (r Rule) Validate() error

Validate guards against common misconfigurations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL