Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig string
Functions ¶
This section is empty.
Types ¶
type Allowlist ¶
type Allowlist struct { // Short human readable description of the allowlist. Description string // Regexes is slice of content regular expressions that are allowed to be ignored. Regexes []*regexp.Regexp // Paths is a slice of path regular expressions that are allowed to be ignored. Paths []*regexp.Regexp // Commits is a slice of commit SHAs that are allowed to be ignored. Commits []string }
Allowlist allows a rule to be ignored for specific regexes, paths, and/or commits
func (*Allowlist) CommitAllowed ¶
CommitAllowed returns true if the commit is allowed to be ignored.
func (*Allowlist) PathAllowed ¶
PathAllowed returns true if the path is allowed to be ignored.
func (*Allowlist) RegexAllowed ¶
RegexAllowed returns true if the regex is allowed to be ignored.
type Rule ¶
type Rule struct { // Description is the description of the rule. Description string // RuleID is a unique identifier for this rule RuleID 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 // Allowlist allows a rule to be ignored for specific // regexes, paths, and/or commits Allowlist Allowlist }
Rules contain information that define details on how to detect secrets
type ViperConfig ¶
type ViperConfig struct { Description string Rules []struct { ID string Description string Entropy float64 SecretGroup int Regex string Path string Tags []string Allowlist struct { Regexes []string Paths []string Commits []string } } Allowlist struct { Regexes []string Paths []string Commits []string } }
ViperConfig is the config struct used by the Viper config package to parse the config file. This struct does not include regular expressions. It is used as an intermediary to convert the Viper config to the Config struct.
func (*ViperConfig) Translate ¶
func (vc *ViperConfig) Translate() (Config, error)
Click to show internal directories.
Click to hide internal directories.