Documentation
¶
Index ¶
- Constants
- func CheckEntropyInterval(entropy Entropy, token string) (isEntropyInInterval bool, entropyLevel float64)
- func MaskSecrets(fileContent string) (string, []maskedSecret.MaskedSecret, error)
- type AllowRule
- type Entropy
- type Multiline
- type Result
- type SecretRegex
- type SecretRule
- type SecretRules
Constants ¶
View Source
const ( Base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" HexChars = "1234567890abcdefABCDEF" )
Variables ¶
This section is empty.
Functions ¶
func CheckEntropyInterval ¶
func CheckEntropyInterval(entropy Entropy, token string) (isEntropyInInterval bool, entropyLevel float64)
CheckEntropyInterval - verifies if a given token's entropy is within expected bounds
func MaskSecrets ¶
func MaskSecrets(fileContent string) (string, []maskedSecret.MaskedSecret, error)
Types ¶
type Result ¶
type Result struct { QueryName string `json:"queryName"` Line int `json:"line"` FileName string `json:"fileName"` Severity string `json:"severity"` }
func ReplaceMatches ¶
func ReplaceMatches(fileName string, result string, regexs []SecretRegex, allowRegexes []*regexp.Regexp) (string, []Result, []maskedSecret.MaskedSecret)
ReplaceMatches If matches between the regex and the file content, then replace the match with the string "<masked>"
type SecretRegex ¶
type SecretRegex struct { QueryName string Regex *regexp.Regexp Multiline Multiline Entropies []Entropy AllowRules []*regexp.Regexp SpecialMask *regexp.Regexp }
func LoadRegexps ¶
func LoadRegexps() ([]SecretRegex, []*regexp.Regexp, error)
LoadRegexps Load custom regexps
type SecretRule ¶
type SecretRules ¶
type SecretRules struct { Rules []SecretRule `json:"rules"` AllowRules []AllowRule `json:"allowRules"` }
Click to show internal directories.
Click to hide internal directories.