Documentation
¶
Index ¶
- Constants
- Variables
- func AllowRuleMatches(s string, allowRules []AllowRule) [][]int
- func CheckEntropyInterval(entropy Entropy, token string) (isEntropyInInterval bool, entropyLevel float64)
- func IsAllowRule(s string, query *RegexQuery, allowRules []AllowRule) bool
- type AllowRule
- type Entropy
- type Inspector
- type MultilineResult
- type RegexQuery
- type RegexRuleStruct
- type RuleMatch
- type SecretTracker
Constants ¶
const ( Base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" HexChars = "1234567890abcdefABCDEF" SecretMask = "<SECRET-MASKED-ON-PURPOSE>" )
Variables ¶
var (
SecretsQueryMetadata map[string]string
)
Functions ¶
func AllowRuleMatches ¶
AllowRuleMatches return all the allow rules matches for the secret queries
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 IsAllowRule ¶
func IsAllowRule(s string, query *RegexQuery, allowRules []AllowRule) bool
IsAllowRule check if string matches any of the allow rules for the secret queries
Types ¶
type AllowRule ¶
type AllowRule struct {
Description string `json:"description"`
RegexStr string `json:"regex"`
Regex *regexp.Regexp
}
func CompileRegex ¶
CompileRegex compiles the regex allow rules
type Inspector ¶
type Inspector struct {
SecretTracker []SecretTracker
// contains filtered or unexported fields
}
func NewInspector ¶
func (*Inspector) GetFailedQueries ¶ added in v2.1.18
GetFailedQueries returns a map of failed queries and the associated error
func (*Inspector) GetQueriesLength ¶
type MultilineResult ¶
type MultilineResult struct {
DetectLineGroup int `json:"detectLineGroup"`
}
type RegexQuery ¶
type RegexRuleStruct ¶
type RegexRuleStruct struct {
Rules []RegexQuery `json:"rules"`
AllowRules []AllowRule `json:"allowRules"`
}
type SecretTracker ¶
type SecretTracker struct {
ResolvedFilePath string
Line int
OriginalContent string
MaskedContent string
}
SecretTracker is Struct created to keep track of the secrets found in the inspector it used for masking all the secrets in the vulnerability preview in the different report formats