Documentation
¶
Index ¶
Constants ¶
const MaxFindings = 1000
MaxFindings caps the findings one ScanText call returns. A scan of text full of matches would otherwise return, and the caller store, as many findings as the text has matches.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner scans text for secrets.
func NewScanner ¶
NewScanner creates a new secret scanner.
func (*Scanner) ScanMetadata ¶
func (s *Scanner) ScanMetadata(metadata map[string]any) []models.SecretFinding
ScanMetadata scans artifact metadata map for secrets.
func (*Scanner) ScanText ¶
func (s *Scanner) ScanText(text string) []models.SecretFinding
ScanText scans a text string for secrets. It returns at most MaxFindings findings, those of the first patterns in pattern order and, within a pattern, in text order; every match, reported or not, is masked in the line hints.