Documentation
¶
Overview ¶
Package security provides secret detection and redaction for extracted code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Finding ¶
type Finding struct {
// FilePath is the file where the secret was found.
FilePath string
// PatternName is the name of the matched pattern.
PatternName string
}
Finding represents a single secret detection finding.
type Pattern ¶
type Pattern struct {
// Name is a human-readable name for the pattern.
Name string
// Regex is the compiled regular expression.
Regex *regexp.Regexp
}
Pattern represents a secret detection pattern.
type ScanResult ¶
type ScanResult struct {
// Findings is the list of detected secrets.
Findings []Finding
// RedactedFiles is the extract result with secrets redacted.
RedactedFiles []extractor.ExtractedFile
}
ScanResult contains the results of a security scan.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner detects and redacts secrets in extracted code.
func NewScanner ¶
NewScanner creates a new Scanner with default patterns. Warnings are written to the given writer (typically os.Stderr).
func (*Scanner) Scan ¶
func (s *Scanner) Scan(result *extractor.ExtractResult) *ScanResult
Scan scans extracted files for secrets, redacts them, and returns findings.
func (*Scanner) SetWarnings ¶
SetWarnings sets the writer for warning output.
Click to show internal directories.
Click to hide internal directories.