Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶
type Analyzer struct {
// contains filtered or unexported fields
}
Analyzer orchestrates the security scanning process
func NewStub ¶ added in v1.0.1
func NewStub() *Analyzer
NewStub creates a minimal analyzer wired to a default detector engine
func (*Analyzer) AnalyzeDependency ¶
func (a *Analyzer) AnalyzeDependency(dep types.Dependency, popularPackages []string) ([]types.Threat, []types.Warning)
AnalyzeDependency analyzes a single dependency for threats
func (*Analyzer) Scan ¶
func (a *Analyzer) Scan(path string, options *ScanOptions) (*ScanResult, error)
Scan performs a security scan of the specified path
func (*Analyzer) ScanPackage ¶ added in v1.0.1
ScanPackage performs a security scan on a single package (for integration tests)
type Conflict ¶
type Conflict struct {
PackageName string `json:"packageName"`
ConflictingVersions []VersionInfo `json:"conflictingVersions"`
Severity string `json:"severity"`
Description string `json:"description"`
}
Conflict represents a dependency version conflict
type DependencyResolver ¶
type DependencyResolver struct {
// contains filtered or unexported fields
}
DependencyResolver handles dependency resolution and conflict detection
func NewDependencyResolver ¶
func NewDependencyResolver(config *config.ScannerConfig) *DependencyResolver
NewDependencyResolver creates a new dependency resolver
func (*DependencyResolver) ResolveDependencies ¶
func (r *DependencyResolver) ResolveDependencies(dependencies []types.Dependency) (*ResolutionResult, error)
ResolveDependencies analyzes dependencies and detects conflicts
type ResolutionResult ¶
type ResolutionResult struct {
Resolved []types.Dependency `json:"resolved"`
Conflicts []Conflict `json:"conflicts"`
Warnings []Warning `json:"warnings"`
}
ResolutionResult contains the results of dependency resolution
type ScanOptions ¶
type ScanOptions struct {
OutputFormat string
SpecificFile string
DeepAnalysis bool
IncludeDevDependencies bool
SimilarityThreshold float64
ExcludePackages []string
AllowEmptyProjects bool
CheckVulnerabilities bool
VulnerabilityDBs []string
VulnConfigPath string
// Recursive scanning options
Recursive bool
WorkspaceAware bool
ConsolidateReport bool
PackageManagers []string
// Supply chain analysis options
EnableSupplyChain bool
AdvancedAnalysis bool
}
ScanOptions contains options for scanning
type ScanResult ¶
type ScanResult struct {
ScanID string `json:"scan_id"`
Timestamp time.Time `json:"timestamp"`
Duration time.Duration `json:"duration"`
Path string `json:"path"`
TotalPackages int `json:"total_packages"`
Threats []types.Threat `json:"threats"`
Warnings []types.Warning `json:"warnings"`
Resolution *ResolutionResult `json:"resolution,omitempty"`
Summary ScanSummary `json:"summary"`
Metadata map[string]interface{} `json:"metadata"`
}
ScanResult contains the results of a security scan
func (*ScanResult) OutputConsole ¶
func (r *ScanResult) OutputConsole(w io.Writer) error
OutputConsole outputs scan results in human-readable console format
func (*ScanResult) OutputHTML ¶
func (r *ScanResult) OutputHTML(w io.Writer) error
OutputHTML outputs scan results in HTML format
func (*ScanResult) OutputJSON ¶
func (r *ScanResult) OutputJSON(w io.Writer) error
OutputJSON outputs scan results in JSON format
type ScanSummary ¶
type ScanSummary struct {
CriticalThreats int `json:"critical_threats"`
HighThreats int `json:"high_threats"`
MediumThreats int `json:"medium_threats"`
LowThreats int `json:"low_threats"`
TotalWarnings int `json:"total_warnings"`
CleanPackages int `json:"clean_packages"`
ConflictCount int `json:"conflict_count"`
}
ScanSummary provides a high-level overview of scan results
type StubRepo ¶ added in v1.0.1
type StubRepo struct{}
func NewStubRepo ¶ added in v1.0.1
func NewStubRepo() *StubRepo