model

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScoreSeverity

func ScoreSeverity(score float64) string

ScoreSeverity maps a CVSS score to a severity label.

Types

type Component

type Component struct {
	Type      string   `json:"type"`
	Name      string   `json:"name"`
	Version   string   `json:"version"`
	PURL      string   `json:"purl,omitempty"`
	CPE       string   `json:"cpe,omitempty"`
	Locations []string `json:"locations,omitempty"`
	Ecosystem string   `json:"ecosystem,omitempty"` // "apk", "deb", "rpm", "npm", "go", etc.
}

Component represents a software component in the inventory.

type ExitCode

type ExitCode int

ExitCode represents the process exit code.

const (
	ExitOK           ExitCode = 0 // No findings above threshold
	ExitFindings     ExitCode = 1 // Findings above threshold
	ExitUsageError   ExitCode = 2 // Usage or configuration error
	ExitRuntimeError ExitCode = 3 // Runtime error (API failure, etc.)
)

type ExitError

type ExitError struct {
	Code ExitCode
}

ExitError wraps an ExitCode so commands can signal a non-zero exit without calling os.Exit directly.

func (*ExitError) Error

func (e *ExitError) Error() string

type Finding

type Finding struct {
	VulnID        string   `json:"vulnID"`
	Aliases       []string `json:"aliases,omitempty"`
	Severity      string   `json:"severity"`
	CVSS          float64  `json:"cvss,omitempty"`
	EPSS          *float64 `json:"epss,omitempty"`
	AIScore       *float64 `json:"aiScore,omitempty"`
	HasExploit    bool     `json:"hasExploit,omitempty"`
	WildExploited bool     `json:"wildExploited,omitempty"`
	ComponentRef  string   `json:"componentRef"`
	Fix           string   `json:"fix,omitempty"`
	References    []string `json:"references,omitempty"`
	Reachability  string   `json:"reachability,omitempty"`
}

Finding represents a vulnerability finding for a component.

type OutputFormat

type OutputFormat string

OutputFormat specifies the output format for command results.

const (
	OutputJSON      OutputFormat = "json"
	OutputTable     OutputFormat = "table"
	OutputSARIF     OutputFormat = "sarif"
	OutputHTML      OutputFormat = "html"
	OutputCycloneDX OutputFormat = "cyclonedx"
)

type SeverityLevel

type SeverityLevel int

SeverityLevel represents vulnerability severity for policy filtering.

const (
	SeverityNone SeverityLevel = iota
	SeverityLow
	SeverityMedium
	SeverityHigh
	SeverityCritical
)

func ParseSeverity

func ParseSeverity(s string) SeverityLevel

ParseSeverity converts a severity string to SeverityLevel (case-insensitive).

func (SeverityLevel) String

func (s SeverityLevel) String() string

String returns the string representation of a SeverityLevel.

Jump to

Keyboard shortcuts

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