Documentation
¶
Index ¶
- func DefaultReportPath(attestDir string) string
- func Redact(v string) string
- func RedactText(line string) string
- func RedactTextWithRules(line string, rules CompiledRules) string
- func WriteReport(path string, report *Report) error
- type ApplyTo
- type CompiledRule
- type CompiledRules
- type Config
- type Finding
- func DetectBuildArgs(buildArgs []string) []Finding
- func DetectBuildArgsWithRules(buildArgs []string, rules CompiledRules) []Finding
- func MatchKeyValueWithRules(key, value string, rules CompiledRules, source Source, location string) []Finding
- func MatchTextWithRules(text string, rules CompiledRules, source Source, location string) []Finding
- func ScanDockerfileForSecretsWithRules(path string, rules CompiledRules) ([]Finding, error)
- func ScanOCIForSecrets(ociLayoutDir string, byteLimit int64) ([]Finding, error)
- func ScanOCIForSecretsWithRules(ociLayoutDir string, byteLimit int64, rules CompiledRules) ([]Finding, error)
- type Mode
- type Report
- type Rule
- type Severity
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultReportPath ¶
func RedactText ¶
RedactText removes secret-like substrings from a line of text using the default rules.
func RedactTextWithRules ¶
func RedactTextWithRules(line string, rules CompiledRules) string
RedactTextWithRules removes secret-like substrings from a line of text using configured rules.
func WriteReport ¶
Types ¶
type CompiledRule ¶
type CompiledRule struct {
Rule
// contains filtered or unexported fields
}
func (CompiledRule) Applies ¶
func (cr CompiledRule) Applies(target ApplyTo) bool
func (CompiledRule) FindAllString ¶ added in v1.0.7
func (cr CompiledRule) FindAllString(value string) []string
func (CompiledRule) MatchString ¶ added in v1.0.7
func (cr CompiledRule) MatchString(value string) bool
type CompiledRules ¶
type CompiledRules struct {
Rules []CompiledRule
}
func CompileConfig ¶
func CompileConfig(cfg Config) (CompiledRules, error)
type Config ¶
type Config struct {
Version string `json:"version" yaml:"version"`
Rules []Rule `json:"rules" yaml:"rules"`
}
func DefaultConfig ¶
func DefaultConfig() Config
func MergeConfig ¶
type Finding ¶
type Finding struct {
Severity Severity `json:"severity"`
Source Source `json:"source"`
Rule string `json:"rule"`
Message string `json:"message"`
Key string `json:"key,omitempty"`
Location string `json:"location,omitempty"`
Match string `json:"match,omitempty"`
}
func DetectBuildArgs ¶
func DetectBuildArgsWithRules ¶
func DetectBuildArgsWithRules(buildArgs []string, rules CompiledRules) []Finding
func MatchKeyValueWithRules ¶
func MatchKeyValueWithRules(key, value string, rules CompiledRules, source Source, location string) []Finding
func MatchTextWithRules ¶
func MatchTextWithRules(text string, rules CompiledRules, source Source, location string) []Finding
func ScanDockerfileForSecretsWithRules ¶
func ScanDockerfileForSecretsWithRules(path string, rules CompiledRules) ([]Finding, error)
func ScanOCIForSecrets ¶
func ScanOCIForSecretsWithRules ¶
func ScanOCIForSecretsWithRules(ociLayoutDir string, byteLimit int64, rules CompiledRules) ([]Finding, error)
type Rule ¶
type Rule struct {
ID string `json:"id" yaml:"id"`
Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
Severity Severity `json:"severity" yaml:"severity"`
AppliesTo []ApplyTo `json:"applies_to,omitempty" yaml:"applies_to,omitempty"`
Regex string `json:"regex,omitempty" yaml:"regex,omitempty"`
Message string `json:"message,omitempty" yaml:"message,omitempty"`
Suggest string `json:"suggestion,omitempty" yaml:"suggestion,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.