Documentation
¶
Index ¶
- Constants
- type Baseline
- type BaselineFinding
- type BaselineManager
- func (bm *BaselineManager) CreateBaseline(results []*scanner.ScanResult, version string) *Baseline
- func (bm *BaselineManager) FilterWithBaseline(results []*scanner.ScanResult, baseline *Baseline) []*scanner.ScanResult
- func (bm *BaselineManager) FilterWithIgnoreList(results []*scanner.ScanResult, ignoreList *IgnoreList) []*scanner.ScanResult
- func (bm *BaselineManager) GenerateIgnoreTemplate() string
- func (bm *BaselineManager) HasBaseline() bool
- func (bm *BaselineManager) HasIgnoreFile() bool
- func (bm *BaselineManager) LoadBaseline() (*Baseline, error)
- func (bm *BaselineManager) LoadIgnoreList() (*IgnoreList, error)
- func (bm *BaselineManager) SaveBaseline(baseline *Baseline) error
- type BaselinePackage
- type Config
- type IgnoreList
- type IgnoreRule
- type Manager
Constants ¶
const BaselineFile = ".secchainbaseline"
BaselineFile is the default name for the baseline file
const IgnoreFile = ".secchainignore"
IgnoreFile is the default name for the ignore file
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Baseline ¶
type Baseline struct {
CreatedAt time.Time `json:"created_at"`
SecChainVersion string `json:"secchain_version"`
Packages []BaselinePackage `json:"packages"`
}
Baseline represents a scan baseline for comparison
type BaselineFinding ¶
type BaselineFinding struct {
Layer string `json:"layer"`
Severity string `json:"severity"`
Reason string `json:"reason"`
RuleID string `json:"rule_id,omitempty"`
}
BaselineFinding represents a finding in the baseline
type BaselineManager ¶
type BaselineManager struct {
// contains filtered or unexported fields
}
BaselineManager handles baseline operations
func NewBaselineManager ¶
func NewBaselineManager(projectPath string) *BaselineManager
NewBaselineManager creates a new baseline manager
func (*BaselineManager) CreateBaseline ¶
func (bm *BaselineManager) CreateBaseline(results []*scanner.ScanResult, version string) *Baseline
CreateBaseline creates a baseline from scan results
func (*BaselineManager) FilterWithBaseline ¶
func (bm *BaselineManager) FilterWithBaseline(results []*scanner.ScanResult, baseline *Baseline) []*scanner.ScanResult
FilterWithBaseline filters results to only show new findings compared to baseline
func (*BaselineManager) FilterWithIgnoreList ¶
func (bm *BaselineManager) FilterWithIgnoreList(results []*scanner.ScanResult, ignoreList *IgnoreList) []*scanner.ScanResult
FilterWithIgnoreList filters results based on ignore rules
func (*BaselineManager) GenerateIgnoreTemplate ¶
func (bm *BaselineManager) GenerateIgnoreTemplate() string
GenerateIgnoreTemplate generates a template ignore file
func (*BaselineManager) HasBaseline ¶
func (bm *BaselineManager) HasBaseline() bool
HasBaseline checks if a baseline file exists
func (*BaselineManager) HasIgnoreFile ¶
func (bm *BaselineManager) HasIgnoreFile() bool
HasIgnoreFile checks if an ignore file exists
func (*BaselineManager) LoadBaseline ¶
func (bm *BaselineManager) LoadBaseline() (*Baseline, error)
LoadBaseline loads a baseline from a file
func (*BaselineManager) LoadIgnoreList ¶
func (bm *BaselineManager) LoadIgnoreList() (*IgnoreList, error)
LoadIgnoreList loads the ignore list from a file
func (*BaselineManager) SaveBaseline ¶
func (bm *BaselineManager) SaveBaseline(baseline *Baseline) error
SaveBaseline saves the baseline to a file
type BaselinePackage ¶
type BaselinePackage struct {
Name string `json:"name"`
Version string `json:"version"`
Ecosystem string `json:"ecosystem"`
Findings []BaselineFinding `json:"findings"`
}
BaselinePackage represents a package in the baseline
type Config ¶
type Config struct {
// General settings
Mode string `toml:"mode"` // interactive, strict, log
MinSeverity string `toml:"min_severity"` // low, medium, high, critical
Offline bool `toml:"offline"`
// Auto-scan settings
AutoScan struct {
Enabled bool `toml:"enabled"`
Ecosystems []string `toml:"ecosystems"` // node, python, rust, go, ruby
} `toml:"auto_scan"`
// Docker settings
Docker struct {
Enabled bool `toml:"enabled"`
Image string `toml:"image"`
Timeout int `toml:"timeout"` // seconds
} `toml:"docker"`
// ClamAV settings
ClamAV struct {
Enabled bool `toml:"enabled"`
Socket string `toml:"socket"`
} `toml:"clamav"`
// YARA settings
YARA struct {
Enabled bool `toml:"enabled"`
RulesPath string `toml:"rules_path"`
CustomRules []string `toml:"custom_rules"`
} `toml:"yara"`
// Cache settings
Cache struct {
Enabled bool `toml:"enabled"`
TTL int `toml:"ttl"` // hours
} `toml:"cache"`
// Output settings
Output struct {
Format string `toml:"format"` // table, json, minimal
ShowClean bool `toml:"show_clean"`
Verbose bool `toml:"verbose"`
} `toml:"output"`
}
Config represents SecChain configuration
type IgnoreList ¶
type IgnoreList struct {
Version string `json:"version"`
Rules []IgnoreRule `json:"rules"`
}
IgnoreList represents a list of ignore rules
type IgnoreRule ¶
type IgnoreRule struct {
Package string `json:"package,omitempty"`
Version string `json:"version,omitempty"`
Ecosystem string `json:"ecosystem,omitempty"`
RuleID string `json:"rule_id,omitempty"`
Reason string `json:"reason"`
ExpiresAt time.Time `json:"expires_at,omitempty"`
}
IgnoreRule represents a rule for ignoring findings
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles configuration operations
func NewManager ¶
NewManager creates a new configuration manager