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 ¶
View Source
const ( Base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" HexChars = "1234567890abcdefABCDEF" )
Variables ¶
View Source
var (
SecretsQueryMetadata map[string]string
)
Functions ¶
func AllowRuleMatches ¶ added in v1.7.4
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 ¶ added in v1.7.1
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 ¶ added in v1.7.1
CompileRegex compiles the regex allow rules
type Inspector ¶
type Inspector struct { SecretTracker []SecretTracker // contains filtered or unexported fields }
func NewInspector ¶
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 ¶ added in v1.6.3
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
Click to show internal directories.
Click to hide internal directories.