risk

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package risk implements explainable attack-path risk scoring (PRD sections 13 and 14).

Index

Constants

View Source
const (
	SeverityInformational = "INFORMATIONAL"
	SeverityLow           = "LOW"
	SeverityMedium        = "MEDIUM"
	SeverityHigh          = "HIGH"
	SeverityCritical      = "CRITICAL"
)

Severity bands (PRD section 13).

Variables

This section is empty.

Functions

func SeverityFor

func SeverityFor(score int) string

SeverityFor maps a 0-100 score to its severity band.

func SeverityRank

func SeverityRank(s string) int

SeverityRank returns an ordinal for comparing severities.

func SortFactors

func SortFactors(fs []Factor)

SortFactors orders a factor breakdown from largest positive contribution to largest penalty, for readable explanations.

Types

type Factor

type Factor struct {
	Name   string `json:"name"`
	Delta  int    `json:"delta"`
	Reason string `json:"reason"`
}

Factor is one explainable contribution to a risk score.

type Result

type Result struct {
	Score      int      `json:"score"`
	Severity   string   `json:"severity"`
	Factors    []Factor `json:"factors"`
	Confidence float64  `json:"confidence"`
}

Result is the outcome of scoring a single path.

func ScorePath

func ScorePath(nodes []*graph.Node, edges []*graph.Edge, confidence float64) Result

ScorePath scores one attack path given its node and edge sequences. The returned result includes a full factor breakdown so that every score remains explainable (PRD section 13).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL