severity

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Common severities
	SeverityCritical      = "Critical"
	SeverityHigh          = "High"
	SeverityMedium        = "Medium"
	SeverityLow           = "Low"
	SeverityInformational = "Informational"
	SeverityNone          = "None"
	SeverityUnknown       = "Unknown"

	SeverityPlusNeedsRemediation = "Needs Remediation"
)

Variables

This section is empty.

Functions

func FuncShieldNameSeverity added in v0.9.0

func FuncShieldNameSeverity() func(sev string) (string, error)

func IsEqualString added in v0.9.2

func IsEqualString(sev, compSev string) (bool, error)

IsEqualString tests if `sev` is of equal severity to the refererence severity `refSev`.

func IsHigherString added in v0.9.2

func IsHigherString(sev, compSev string) (bool, error)

IsHigherString tests if `sev` is of higher severity than the refererence severity `refSev`.

func IsLowerString added in v0.9.2

func IsLowerString(sev, compSev string) (bool, error)

IsLowerString tests if `sev` is of lower severity than the refererence severity `refSev`.

func NeedsRemediation added in v0.9.2

func NeedsRemediation(sev string) bool

func ParseSeveritiesString added in v0.9.2

func ParseSeveritiesString(sevs []string) ([]string, error)

func SeveritiesAll

func SeveritiesAll() []string

func SeveritiesAnalyzed

func SeveritiesAnalyzed() []string

func SeveritiesFinding

func SeveritiesFinding() []string

func SeveritiesHigher added in v0.4.0

func SeveritiesHigher(sevs []string, sev string, inclusive bool) ([]string, error)

SeveritiesHigher returns a subset of the provided severities with elements that with a lower index than the provided severity. The provided severities mus be ranked from high to low.

func SeveritiesLower added in v0.5.0

func SeveritiesLower(sevs []string, sev string, inclusive bool) ([]string, error)

SeveritiesLower returns a subset of the provided severities with elements that with a higher index than the provided severity. The provided severities mus be ranked from high to low.

func SeverityCountColorHex added in v0.9.0

func SeverityCountColorHex(sev, sevCutoffIncl string, count int) (string, error)

Types

type MapBool

type MapBool map[string]bool

func NewMapBool

func NewMapBool(def bool) MapBool

func (MapBool) AllTrue

func (mb MapBool) AllTrue(strict bool) bool

AllTrueStrict checks if all severities are true. Strict checks that no additional severities are included in the map.

type Severity added in v0.9.0

type Severity int
const (
	Critical Severity = iota
	High
	Medium
	Low
	Informational
	None
	Unknown
)

func ParseSeverities added in v0.7.0

func ParseSeverities(sevs []string) ([]Severity, error)

func ParseSeverity

func ParseSeverity(sev string) (string, Severity, error)

func (Severity) IsEqual added in v0.9.0

func (s Severity) IsEqual(sev Severity) bool

func (Severity) IsHigher added in v0.9.0

func (s Severity) IsHigher(sev Severity) bool

func (Severity) IsLower added in v0.9.0

func (s Severity) IsLower(sev Severity) bool

func (Severity) NeedsRemediation added in v0.9.2

func (s Severity) NeedsRemediation() bool

type SeverityCountsSet added in v0.9.0

type SeverityCountsSet struct {
	Histogram *histogram.Histogram
}

func (SeverityCountsSet) WriteShields added in v0.9.0

func (sc SeverityCountsSet) WriteShields(sevs []string,
	fontSize int,
	sevCutoff string,
	fnFilepath func(sev string) (string, error),
	fnShieldName func(sev string) (string, error),
	perm os.FileMode,
) error

type SeverityMapCVSS added in v0.7.0

type SeverityMapCVSS map[string]decimal.Decimal

func NewSeverityMapCVSSSeveritiesOnly added in v0.7.0

func NewSeverityMapCVSSSeveritiesOnly(severities []string) (SeverityMapCVSS, error)

func NewSeverityMapFromFloat32

func NewSeverityMapFromFloat32(m map[string]float32) (SeverityMapCVSS, error)

func SeverityMapScoreDefault added in v0.4.0

func SeverityMapScoreDefault() SeverityMapCVSS

func (SeverityMapCVSS) SeverityFromScore added in v0.7.0

func (sm SeverityMapCVSS) SeverityFromScore(score decimal.Decimal) (string, error)

func (SeverityMapCVSS) SeverityFromScoreFloat32 added in v0.7.0

func (sm SeverityMapCVSS) SeverityFromScoreFloat32(score float32) (string, error)

Jump to

Keyboard shortcuts

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