Documentation
¶
Overview ¶
Package prioritization turns a finding's severity and its component's risk classification (exposure × business criticality) into a single Priority band. It is the engine behind "what do I fix first": two small, auditable lookup matrices —
re × bc → context tier (C1–C4) "how much we care about any issue here" context × severity → priority (P1–P4) "this finding's rank"
The default matrices ship opinionated and are overridable. See docs/concepts.md (prioritization).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context string
Context is the "how much we care about this component" tier (C1 highest concern, C4 lowest), derived from exposure × criticality.
type Matrices ¶
type Matrices struct {
// ContextTier maps exposure → criticality → context tier.
ContextTier map[saga.Exposure]map[saga.Criticality]Context
// PriorityBand maps context tier → normalized severity → priority.
PriorityBand map[Context]map[sarif.Severity]Priority
}
Matrices holds the two lookup tables. The maps are exported so callers can start from DefaultMatrices and override individual cells (e.g. from Saga config).
func DefaultMatrices ¶
func DefaultMatrices() Matrices
DefaultMatrices returns the shipped, opinionated matrices (a fresh copy, safe to mutate for overrides). Both are monotonic: raising exposure, criticality, or severity never lowers priority, and P1 is deliberately scarce. See docs/concepts.md (prioritization).
func (Matrices) ContextOf ¶
ContextOf returns the context tier for a component's classification. Unclassified or unknown exposure/criticality is treated as the most severe level (public / critical), so findings on unclassified components surface rather than hide.
func (Matrices) Prioritize ¶
func (m Matrices) Prioritize(exposure saga.Exposure, criticality saga.Criticality, severity sarif.Severity) Priority
Prioritize combines both matrices: it ranks a finding of the given severity on a component with the given exposure and criticality.