Documentation ¶
Index ¶
Constants ¶
const DefaultConfig = `` /* 3581-byte string literal not displayed */
DefaultConfig is the default gitleaks configuration. If --config={path-to-config} is set than the config located at {path-to-config} will be used. Alternatively, if --repo-config is set then gitleaks will attempt to use the config set in a gitleaks.toml or .gitleaks.toml file in the repo that is run with --repo-config set.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { FileRegex *regexp.Regexp Message *regexp.Regexp Rules []Rule Whitelist struct { Description string Commits []string File *regexp.Regexp } }
Config is a composite struct of Rules and Whitelists Each Rule contains a description, regular expression, tags, and whitelists if available
type Rule ¶
type Rule struct { Description string Regex *regexp.Regexp Tags []string Whitelist []Whitelist Entropy []entropy }
Rule is a struct that contains information that is loaded from a gitleaks config. This struct is used in the Config struct as an array of Rules and is iterated over during an audit. Each rule will be checked. If a regex match is found AND that match is not whitelisted (globally or locally), then a leak will be appended to the final audit report.
type TomlLoader ¶
type TomlLoader struct { Global struct { File string Message string } Whitelist struct { Description string Commits []string File string } Rules []struct { Description string Regex string Tags []string Entropies []string Whitelist []struct { Description string Regex string File string } } }
TomlLoader gets loaded with the values from a gitleaks toml config see the config in config/defaults.go for an example. TomlLoader is used to generate Config values (compiling regexes, etc).
func (TomlLoader) Parse ¶
func (tomlLoader TomlLoader) Parse() (Config, error)
Parse will parse the values set in a TomlLoader and use those values to create compiled regular expressions and rules used in audits