cvss

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version20 = "2.0"
	Version30 = "3.0"
	Version31 = "3.1"
	Version40 = "4.0"

	Prefix30 = "CVSS:3.0/"
	Prefix31 = "CVSS:3.1/"
	Prefix40 = "CVSS:4.0/"
)

Variables

View Source
var CvssType = cel.ObjectType("cvss", traits.ReceiverType)
View Source
var Identity = class.MustParseIdentity("cvss@v0")

Functions

func Score added in v1.3.2

func Score(vector string) (float64, error)

Score parses a CVSS vector string and returns its numeric (base) score. It is exported so sibling plugins (e.g. osv) can reuse the version-aware scoring without duplicating the parsing logic.

func Severity added in v1.3.2

func Severity(vector string) (string, error)

Severity parses a CVSS vector string and returns its qualitative rating (CRITICAL/HIGH/MEDIUM/LOW/NONE). Exported for reuse by sibling plugins.

Types

type CvssTool

type CvssTool struct{}

func (*CvssTool) CompileOptions

func (ct *CvssTool) CompileOptions() []cel.EnvOption

func (*CvssTool) ConvertToNative

func (*CvssTool) ConvertToNative(_ reflect.Type) (any, error)

func (*CvssTool) ConvertToType

func (ct *CvssTool) ConvertToType(typeVal ref.Type) ref.Val

func (*CvssTool) Equal

func (*CvssTool) Equal(_ ref.Val) ref.Val

func (*CvssTool) Functions

func (ct *CvssTool) Functions() []cel.EnvOption

func (*CvssTool) ProgramOptions

func (*CvssTool) ProgramOptions() []cel.ProgramOption

func (*CvssTool) Type

func (*CvssTool) Type() ref.Type

func (*CvssTool) Value

func (ct *CvssTool) Value() any

type Plugin

type Plugin struct {
	Tool *CvssTool
}

func New

func New() *Plugin

func (*Plugin) CanRegisterFor

func (p *Plugin) CanRegisterFor(c class.Class) bool

func (*Plugin) Capabilities

func (p *Plugin) Capabilities() []api.Capability

func (*Plugin) Identity added in v1.3.2

func (p *Plugin) Identity() *class.Identity

func (*Plugin) Library

func (p *Plugin) Library() cel.EnvOption

func (*Plugin) VarValues

func (p *Plugin) VarValues(_ *papi.Policy, _ attestation.Subject, _ []attestation.Predicate) map[string]any

type TypeAdapter

type TypeAdapter struct{}

func (TypeAdapter) NativeToValue

func (TypeAdapter) NativeToValue(value any) ref.Val

Jump to

Keyboard shortcuts

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