Documentation
¶
Overview ¶
Package security provides security scanning capabilities
Index ¶
- func FormatFindings(findings []Finding) string
- type Finding
- type LeakScanner
- func (s *LeakScanner) LoadGitleaksIgnore(repoPath string) error
- func (s *LeakScanner) ScanDirectory(ctx context.Context, path string) (*ScanResult, error)
- func (s *LeakScanner) ScanGitRepo(ctx context.Context, repoPath string) (*ScanResult, error)
- func (s *LeakScanner) ScanStagedChanges(ctx context.Context, repoPath string) (*ScanResult, error)
- func (s *LeakScanner) ScanUnpushedCommits(ctx context.Context, repoPath string) (*ScanResult, error)
- type ScanResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatFindings ¶
FormatFindings formats findings for display
Types ¶
type Finding ¶
type Finding struct {
RuleID string
Description string
File string
Line int
Secret string // Redacted
Match string
Commit string
Author string
Date string
}
Finding represents a detected secret
type LeakScanner ¶
type LeakScanner struct {
// contains filtered or unexported fields
}
LeakScanner provides secret detection capabilities
func NewLeakScanner ¶
func NewLeakScanner() (*LeakScanner, error)
NewLeakScanner creates a new leak scanner with default gitleaks rules
func (*LeakScanner) LoadGitleaksIgnore ¶
func (s *LeakScanner) LoadGitleaksIgnore(repoPath string) error
LoadGitleaksIgnore loads ignore patterns from .gitleaksignore
func (*LeakScanner) ScanDirectory ¶
func (s *LeakScanner) ScanDirectory(ctx context.Context, path string) (*ScanResult, error)
ScanDirectory scans a directory for secrets
func (*LeakScanner) ScanGitRepo ¶
func (s *LeakScanner) ScanGitRepo(ctx context.Context, repoPath string) (*ScanResult, error)
ScanGitRepo scans git history for secrets
func (*LeakScanner) ScanStagedChanges ¶
func (s *LeakScanner) ScanStagedChanges(ctx context.Context, repoPath string) (*ScanResult, error)
ScanStagedChanges scans only staged git changes (for pre-commit/pre-push)
func (*LeakScanner) ScanUnpushedCommits ¶
func (s *LeakScanner) ScanUnpushedCommits(ctx context.Context, repoPath string) (*ScanResult, error)
ScanUnpushedCommits scans commits that haven't been pushed yet
type ScanResult ¶
ScanResult contains the results of a leak scan
Click to show internal directories.
Click to hide internal directories.