Documentation
¶
Overview ¶
internal/results/enrich.go
File: internal/results/pipeline.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CWEProvider ¶
Defines an interface for CWE data retrieval. REFACTORED: Updated interface to accept context.Context for cancellation/timeout propagation.
type Enricher ¶
type Enricher struct {
// contains filtered or unexported fields
}
Enricher is responsible for enhancing findings with additional context.
func NewEnricher ¶
func NewEnricher(cweProvider providers.CWEProvider, logger *zap.Logger) *Enricher
NewEnricher creates a new Enricher instance.
func (*Enricher) EnrichFinding ¶
EnrichFinding enhances a single finding.
type NormalizedFinding ¶
Represents a finding that has been standardized.
func Normalize ¶
func Normalize(finding schemas.Finding) NormalizedFinding
Converts a raw finding into a normalized finding. REFACTORED: It now maps the raw severity string to a canonical StandardSeverity.
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline manages the processing of raw findings into a final report.
func NewPipeline ¶
NewPipeline creates a new results processing pipeline.
type PipelineConfig ¶
type PipelineConfig struct {
ScoreConfig ScoreConfig
// CWEProvider is optional. If nil, enrichment will be skipped.
CWEProvider CWEProvider
}
Holds all configuration required for the results pipeline. REFACTORED: Introduced to centralize configuration and dependencies.
type Report ¶
type Report struct {
ScanID string `json:"scan_id"`
Findings []schemas.Finding `json:"findings"`
Summary map[string]int `json:"summary"`
}
Report represents the final aggregated scan report.
type ScoreConfig ¶
type ScoreConfig struct {
// Keys should correspond to the canonical StandardSeverity strings.
SeverityWeights map[string]float64
}
Defines the parameters for the prioritization process.
type StandardSeverity ¶
type StandardSeverity string
Defines canonical severity levels used internally.
const ( SeverityCritical StandardSeverity = "CRITICAL" SeverityHigh StandardSeverity = "HIGH" SeverityMedium StandardSeverity = "MEDIUM" SeverityLow StandardSeverity = "LOW" SeverityInfo StandardSeverity = "INFO" SeverityUnknown StandardSeverity = "UNKNOWN" )