base

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ModifiedAttackComplexityValueMap = map[ModifiedAttackComplexity]float64{
	ModifiedAttackComplexityHigh: 0.44,
	ModifiedAttackComplexityLow:  0.77,
}

Functions

This section is empty.

Types

type AttackComplexity

type AttackComplexity int

AttackComplexity is metric type for Base Metrics

const (
	AttackComplexityUnknown AttackComplexity = iota
	AttackComplexityHigh
	AttackComplexityLow
)

Constant of AttackComplexity result

func GetAttackComplexity

func GetAttackComplexity(s string) AttackComplexity

GetAttackComplexity returns result of AttackComplexity metric

func (AttackComplexity) IsDefined

func (ac AttackComplexity) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (AttackComplexity) NameOfValue

func (ac AttackComplexity) NameOfValue(lang language.Tag) string

NameOfValue returns string name of value for display

func (AttackComplexity) String

func (ac AttackComplexity) String() string

func (AttackComplexity) Title

func (ac AttackComplexity) Title(lang language.Tag) string

Title returns string instance name for display

func (AttackComplexity) Value

func (ac AttackComplexity) Value() float64

Value returns value of AttackComplexity metric

type AttackVector

type AttackVector int

AttackVector is metric type for Base Metrics

const (
	AttackVectorUnknown AttackVector = iota
	AttackVectorPhysical
	AttackVectorLocal
	AttackVectorAdjacent
	AttackVectorNetwork
)

Constant of AttackVector result

func GetAttackVector

func GetAttackVector(s string) AttackVector

GetAttackVector returns result of AttackVector metric

func (AttackVector) IsDefined

func (av AttackVector) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (AttackVector) NameOfValue

func (av AttackVector) NameOfValue(lang language.Tag) string

NameOfValue returns string name of value for display

func (AttackVector) String

func (av AttackVector) String() string

func (AttackVector) Title

func (av AttackVector) Title(lang language.Tag) string

Title returns string instance name for display

func (AttackVector) Value

func (av AttackVector) Value() float64

Value returns value of AttackVector metric

type AvailabilityImpact

type AvailabilityImpact int

AvailabilityImpact is metric type for Base Metrics

const (
	AvailabilityImpactUnknown AvailabilityImpact = iota
	AvailabilityImpactNone
	AvailabilityImpactLow
	AvailabilityImpactHigh
)

Constant of AvailabilityImpact result

func GetAvailabilityImpact

func GetAvailabilityImpact(s string) AvailabilityImpact

GetAvailabilityImpact returns result of AvailabilityImpact metric

func (AvailabilityImpact) IsDefined

func (ai AvailabilityImpact) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (AvailabilityImpact) NameOfValue

func (a AvailabilityImpact) NameOfValue(lang language.Tag) string

NameOfValue returns string name of value for display

func (AvailabilityImpact) String

func (ai AvailabilityImpact) String() string

func (AvailabilityImpact) Title

func (a AvailabilityImpact) Title(lang language.Tag) string

Title returns string instance name for display

func (AvailabilityImpact) Value

func (ai AvailabilityImpact) Value() float64

Value returns value of AvailabilityImpact metric

type AvailabilityRequirement added in v1.1.0

type AvailabilityRequirement int

AttackVector is metric type for Base Metrics

const (
	AvailabilityRequirementNotDefined AvailabilityRequirement = iota
	AvailabilityRequirementLow
	AvailabilityRequirementMedium
	AvailabilityRequirementHigh
)

Constant of AttackVector result

func GetAvailabilityRequirement added in v1.1.0

func GetAvailabilityRequirement(s string) AvailabilityRequirement

GetAvailabilityRequirement returns result of ConfidentalityRequirement metric

func (AvailabilityRequirement) IsDefined added in v1.1.0

func (ar AvailabilityRequirement) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (AvailabilityRequirement) String added in v1.1.0

func (ar AvailabilityRequirement) String() string

func (AvailabilityRequirement) Value added in v1.1.0

func (ar AvailabilityRequirement) Value() float64

Value returns value of AttackVector metric

type CVSSReport

type CVSSReport struct {
	BaseMetrics, MetricValue string //titles
	AVName, AVValue          string //AttackVector
	ACName, ACValue          string //AttackComplexity
	PRName, PRValue          string //PrivilegesRequired
	UIName, UIValue          string //UserInteraction
	SName, SValue            string //Scope
	CName, CValue            string //ConfidentialityImpact
	IName, IValue            string //IntegrityImpact
	AName, AValue            string //AvailabilityImpact
}

CVSSReport is dataset for CVSS report

type ConfidentialityImpact

type ConfidentialityImpact int

ConfidentialityImpact is metric type for Base Metrics

const (
	ConfidentialityImpactUnknown ConfidentialityImpact = iota
	ConfidentialityImpactNone
	ConfidentialityImpactLow
	ConfidentialityImpactHigh
)

Constant of ConfidentialityImpact result

func GetConfidentialityImpact

func GetConfidentialityImpact(s string) ConfidentialityImpact

GetConfidentialityImpact returns result of ConfidentialityImpact metric

func (ConfidentialityImpact) IsDefined

func (ci ConfidentialityImpact) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (ConfidentialityImpact) NameOfValue

func (c ConfidentialityImpact) NameOfValue(lang language.Tag) string

NameOfValue returns string name of value for display

func (ConfidentialityImpact) String

func (ci ConfidentialityImpact) String() string

func (ConfidentialityImpact) Title

func (c ConfidentialityImpact) Title(lang language.Tag) string

Title returns string instance name for display

func (ConfidentialityImpact) Value

func (ci ConfidentialityImpact) Value() float64

Value returns value of ConfidentialityImpact metric

type ConfidentialityRequirement added in v1.1.0

type ConfidentialityRequirement int

AttackVector is metric type for Base Metrics

const (
	ConfidentialityRequirementNotDefined ConfidentialityRequirement = iota
	ConfidentialityRequirementLow
	ConfidentialityRequirementMedium
	ConfidentialityRequirementHigh
)

Constant of AttackVector result

func GetConfidentialityRequirement added in v1.1.0

func GetConfidentialityRequirement(s string) ConfidentialityRequirement

GetConfidentialityRequirement returns result of ConfidentalityRequirement metric

func (ConfidentialityRequirement) IsDefined added in v1.1.0

func (cr ConfidentialityRequirement) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (ConfidentialityRequirement) String added in v1.1.0

func (cr ConfidentialityRequirement) String() string

func (ConfidentialityRequirement) Value added in v1.1.0

Value returns value of AttackVector metric

type Exploitability added in v1.1.0

type Exploitability int

Exploitability is metric type for Temporal Metrics

const (
	ExploitabilityNotDefined Exploitability = iota
	ExploitabilityUnproven
	ExploitabilityProofOfConcept
	ExploitabilityFunctional
	ExploitabilityHigh
)

Constant of Exploitability result

func GetExploitability added in v1.1.0

func GetExploitability(s string) Exploitability

GetExploitability returns result of Exploitability metric

func (Exploitability) IsDefined added in v1.1.0

func (ai Exploitability) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (Exploitability) String added in v1.1.0

func (ai Exploitability) String() string

func (Exploitability) Value added in v1.1.0

func (ai Exploitability) Value() float64

Value returns value of Exploitability metric

type IntegrityImpact

type IntegrityImpact int

IntegrityImpact is metric type for Base Metrics

const (
	IntegrityImpactUnknown IntegrityImpact = iota
	IntegrityImpactNone
	IntegrityImpactLow
	IntegrityImpactHigh
)

Constant of IntegrityImpact result

func GetIntegrityImpact

func GetIntegrityImpact(s string) IntegrityImpact

GetIntegrityImpact returns result of IntegrityImpact metric

func (IntegrityImpact) IsDefined

func (ii IntegrityImpact) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (IntegrityImpact) NameOfValue

func (i IntegrityImpact) NameOfValue(lang language.Tag) string

NameOfValue returns string name of value for display

func (IntegrityImpact) String

func (ii IntegrityImpact) String() string

func (IntegrityImpact) Title

func (i IntegrityImpact) Title(lang language.Tag) string

Title returns string instance name for display

func (IntegrityImpact) Value

func (ii IntegrityImpact) Value() float64

Value returns value of IntegrityImpact metric

type IntegrityRequirement added in v1.1.0

type IntegrityRequirement int

AttackVector is metric type for Base Metrics

const (
	IntegrityRequirementNotDefined IntegrityRequirement = iota
	IntegrityRequirementLow
	IntegrityRequirementMedium
	IntegrityRequirementHigh
)

Constant of AttackVector result

func GetIntegrityRequirement added in v1.1.0

func GetIntegrityRequirement(s string) IntegrityRequirement

GetIntegrityRequirement returns result of ConfidentalityRequirement metric

func (IntegrityRequirement) IsDefined added in v1.1.0

func (ir IntegrityRequirement) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (IntegrityRequirement) String added in v1.1.0

func (ir IntegrityRequirement) String() string

func (IntegrityRequirement) Value added in v1.1.0

func (ir IntegrityRequirement) Value() float64

Value returns value of AttackVector metric

type Metrics

Metrics is Base Metrics for CVSSv3

func Decode

func Decode(vector string) (*Metrics, error)

Decode returns Metrics instance by CVSSv3 vector

func NewMetrics

func NewMetrics() *Metrics

NewMetrics returns Metrics instance

func (*Metrics) Encode

func (m *Metrics) Encode() (string, error)

Encode returns CVSSv3 vector string

func (*Metrics) EnvironmentalScore added in v1.1.0

func (m *Metrics) EnvironmentalScore() float64

func (*Metrics) GetError

func (m *Metrics) GetError() error

GetError returns error instance if undefined metric

func (*Metrics) GetSeverity

func (m *Metrics) GetSeverity() Severity

GetSeverity returns severity by score of Base metrics

func (*Metrics) NameOfvalue

func (m *Metrics) NameOfvalue(lang language.Tag) string

NameOfvalue returns string instance name for display

func (*Metrics) Report

func (m *Metrics) Report(r io.Reader, lang language.Tag) (io.Reader, error)

Report returns string of CVSS report

func (*Metrics) Score

func (m *Metrics) Score() float64

Score returns score of Base metrics

func (*Metrics) TemporalScore added in v1.1.0

func (m *Metrics) TemporalScore() float64

func (*Metrics) Title

func (m *Metrics) Title(lang language.Tag) string

Title returns string instance name for display

type ModifiedAttackComplexity added in v1.1.0

type ModifiedAttackComplexity int

ModifiedAttackComplexity is metric type for Base Metrics

const (
	ModifiedAttackComplexityNotDefined ModifiedAttackComplexity = iota
	ModifiedAttackComplexityHigh
	ModifiedAttackComplexityLow
)

Constant of ModifiedAttackComplexity result

func GetModifiedAttackComplexity added in v1.1.0

func GetModifiedAttackComplexity(s string) ModifiedAttackComplexity

GetModifiedAttackComplexity returns result of ModifiedAttackComplexity metric

func (ModifiedAttackComplexity) IsDefined added in v1.1.0

func (mac ModifiedAttackComplexity) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (ModifiedAttackComplexity) String added in v1.1.0

func (mac ModifiedAttackComplexity) String() string

func (ModifiedAttackComplexity) Value added in v1.1.0

func (mac ModifiedAttackComplexity) Value() float64

Value returns value of ModifiedAttackComplexity metric

type ModifiedAttackVector added in v1.1.0

type ModifiedAttackVector int

ModifiedAttackVector is metric type for Base Metrics

const (
	ModifiedAttackVectorNotDefined ModifiedAttackVector = iota
	ModifiedAttackVectorPhysical
	ModifiedAttackVectorLocal
	ModifiedAttackVectorAdjacent
	ModifiedAttackVectorNetwork
)

Constant of ModifiedAttackVector result

func GetModifiedAttackVector added in v1.1.0

func GetModifiedAttackVector(s string) ModifiedAttackVector

GetModifiedAttackVector returns result of ModifiedAttackVector metric

func (ModifiedAttackVector) IsDefined added in v1.1.0

func (mav ModifiedAttackVector) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (ModifiedAttackVector) String added in v1.1.0

func (mav ModifiedAttackVector) String() string

func (ModifiedAttackVector) Value added in v1.1.0

func (mav ModifiedAttackVector) Value() float64

Value returns value of ModifiedAttackVector metric

type ModifiedAvailabilityImpact added in v1.1.0

type ModifiedAvailabilityImpact int

ModifiedAvailabilityImpact is metric type for Base Metrics

const (
	ModifiedAvailabilityImpactNotDefined ModifiedAvailabilityImpact = iota
	ModifiedAvailabilityImpactNone
	ModifiedAvailabilityImpactLow
	ModifiedAvailabilityImpactHigh
)

Constant of ModifiedAvailabilityImpact result

func GetModifiedAvailabilityImpact added in v1.1.0

func GetModifiedAvailabilityImpact(s string) ModifiedAvailabilityImpact

GetModifiedAvailabilityImpact returns result of ModifiedAvailabilityImpact metric

func (ModifiedAvailabilityImpact) IsDefined added in v1.1.0

func (mai ModifiedAvailabilityImpact) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (ModifiedAvailabilityImpact) String added in v1.1.0

func (mai ModifiedAvailabilityImpact) String() string

func (ModifiedAvailabilityImpact) Value added in v1.1.0

func (mai ModifiedAvailabilityImpact) Value() float64

Value returns value of ModifiedAvailabilityImpact metric

type ModifiedConfidentialityImpact added in v1.1.0

type ModifiedConfidentialityImpact int

ModifiedConfidentialityImpact is metric type for Base Metrics

const (
	ModifiedConfidentialityImpactNotDefined ModifiedConfidentialityImpact = iota
	ModifiedConfidentialityImpactNone
	ModifiedConfidentialityImpactLow
	ModifiedConfidentialityImpactHigh
)

Constant of ModifiedConfidentialityImpact result

func GetModifiedConfidentialityImpact added in v1.1.0

func GetModifiedConfidentialityImpact(s string) ModifiedConfidentialityImpact

GetModifiedConfidentialityImpact returns result of ModifiedConfidentialityImpact metric

func (ModifiedConfidentialityImpact) IsDefined added in v1.1.0

func (mci ModifiedConfidentialityImpact) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (ModifiedConfidentialityImpact) String added in v1.1.0

func (ModifiedConfidentialityImpact) Value added in v1.1.0

Value returns value of ModifiedConfidentialityImpact metric

type ModifiedIntegrityImpact added in v1.1.0

type ModifiedIntegrityImpact int

ModifiedIntegrityImpact is metric type for Base Metrics

const (
	ModifiedIntegrityImpactNotDefined ModifiedIntegrityImpact = iota
	ModifiedIntegrityImpactNone
	ModifiedIntegrityImpactLow
	ModifiedIntegrityImpactHigh
)

Constant of ModifiedIntegrityImpact result

func GetModifiedIntegrityImpact added in v1.1.0

func GetModifiedIntegrityImpact(s string) ModifiedIntegrityImpact

GetModifiedIntegrityImpact returns result of ModifiedIntegrityImpact metric

func (ModifiedIntegrityImpact) IsDefined added in v1.1.0

func (mii ModifiedIntegrityImpact) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (ModifiedIntegrityImpact) String added in v1.1.0

func (mii ModifiedIntegrityImpact) String() string

func (ModifiedIntegrityImpact) Value added in v1.1.0

func (mii ModifiedIntegrityImpact) Value() float64

Value returns value of ModifiedIntegrityImpact metric

type ModifiedPrivilegesRequired added in v1.1.0

type ModifiedPrivilegesRequired int

ModifiedPrivilegesRequired is metric type for Base Metrics

const (
	ModifiedPrivilegesRequiredUnknown ModifiedPrivilegesRequired = iota
	ModifiedPrivilegesRequiredNotDefined
	ModifiedPrivilegesRequiredHigh
	ModifiedPrivilegesRequiredLow
	ModifiedPrivilegesRequiredNone
)

Constant of ModifiedPrivilegesRequired result

func GetModifiedPrivilegesRequired added in v1.1.0

func GetModifiedPrivilegesRequired(s string) ModifiedPrivilegesRequired

GetModifiedPrivilegesRequired returns result of ModifiedPrivilegesRequired metric

func (ModifiedPrivilegesRequired) IsDefined added in v1.1.0

func (mpr ModifiedPrivilegesRequired) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (ModifiedPrivilegesRequired) String added in v1.1.0

func (mpr ModifiedPrivilegesRequired) String() string

func (ModifiedPrivilegesRequired) Value added in v1.1.0

Value returns value of ModifiedPrivilegesRequired metric

type ModifiedScope added in v1.1.0

type ModifiedScope int

ModifiedScope is metric type for Base Metrics

const (
	ModifiedScopeNotDefined ModifiedScope = iota
	ModifiedScopeUnchanged
	ModifiedScopeChanged
)

Constant of ModifiedScope result

func GetModifiedScope added in v1.1.0

func GetModifiedScope(s string) ModifiedScope

GetModifiedScope returns result of ModifiedScope metric

func (ModifiedScope) IsDefined added in v1.1.0

func (msc ModifiedScope) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (ModifiedScope) String added in v1.1.0

func (msc ModifiedScope) String() string

type ModifiedUserInteraction added in v1.1.0

type ModifiedUserInteraction int

ModifiedUserInteraction is metric type for Base Metrics

const (
	ModifiedUserInteractionNotDefined ModifiedUserInteraction = iota
	ModifiedUserInteractionRequired
	ModifiedUserInteractionNone
)

Constant of ModifiedUserInteraction result

func GetModifiedUserInteraction added in v1.1.0

func GetModifiedUserInteraction(s string) ModifiedUserInteraction

GetModifiedUserInteraction returns result of ModifiedUserInteraction metric

func (ModifiedUserInteraction) IsDefined added in v1.1.0

func (mui ModifiedUserInteraction) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (ModifiedUserInteraction) String added in v1.1.0

func (mui ModifiedUserInteraction) String() string

func (ModifiedUserInteraction) Value added in v1.1.0

func (mui ModifiedUserInteraction) Value() float64

Value returns value of ModifiedUserInteraction metric

type PrivilegesRequired

type PrivilegesRequired int

PrivilegesRequired is metric type for Base Metrics

const (
	PrivilegesRequiredUnknown PrivilegesRequired = iota
	PrivilegesRequiredHigh
	PrivilegesRequiredLow
	PrivilegesRequiredNone
)

Constant of PrivilegesRequired result

func GetPrivilegesRequired

func GetPrivilegesRequired(s string) PrivilegesRequired

GetPrivilegesRequired returns result of PrivilegesRequired metric

func (PrivilegesRequired) IsDefined

func (pr PrivilegesRequired) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (PrivilegesRequired) NameOfValue

func (pr PrivilegesRequired) NameOfValue(lang language.Tag) string

NameOfValue returns string name of value for display

func (PrivilegesRequired) String

func (pr PrivilegesRequired) String() string

func (PrivilegesRequired) Title

func (pr PrivilegesRequired) Title(lang language.Tag) string

Title returns string instance name for display

func (PrivilegesRequired) Value

func (pr PrivilegesRequired) Value(s Scope) float64

Value returns value of PrivilegesRequired metric

type RemediationLevel added in v1.1.0

type RemediationLevel int

RemediationLevel is metric type for Temporal Metrics

const (
	RemediationLevelNotDefined RemediationLevel = iota
	RemediationLevelOfficialFix
	RemediationLevelTemporaryFix
	RemediationLevelWorkaround
	RemediationLevelUnavailable
)

Constant of RemediationLevel result

func GetRemediationLevel added in v1.1.0

func GetRemediationLevel(s string) RemediationLevel

GetRemediationLevel returns result of RemediationLevel metric

func (RemediationLevel) IsDefined added in v1.1.0

func (ai RemediationLevel) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (RemediationLevel) String added in v1.1.0

func (ai RemediationLevel) String() string

func (RemediationLevel) Value added in v1.1.0

func (ai RemediationLevel) Value() float64

Value returns value of RemediationLevel metric

type ReportConfidence added in v1.1.0

type ReportConfidence int

ReportConfidence is metric type for Temporal Metrics

const (
	ReportConfidenceNotDefined ReportConfidence = iota
	ReportConfidenceUnknown
	ReportConfidenceReasonable
	ReportConfidenceConfirmed
)

Constant of ReportConfidence result

func GetReportConfidence added in v1.1.0

func GetReportConfidence(s string) ReportConfidence

GetReportConfidence returns result of ReportConfidence metric

func (ReportConfidence) IsDefined added in v1.1.0

func (ai ReportConfidence) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (ReportConfidence) String added in v1.1.0

func (ai ReportConfidence) String() string

func (ReportConfidence) Value added in v1.1.0

func (ai ReportConfidence) Value() float64

Value returns value of ReportConfidence metric

type Scope

type Scope int

Scope is metric type for Base Metrics

const (
	ScopeUnknown Scope = iota
	ScopeUnchanged
	ScopeChanged
)

Constant of Scope result

func GetScope

func GetScope(s string) Scope

GetScope returns result of Scope metric

func (Scope) IsDefined

func (sc Scope) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (Scope) NameOfValue

func (s Scope) NameOfValue(lang language.Tag) string

NameOfValue returns string name of value for display

func (Scope) String

func (sc Scope) String() string

func (Scope) Title

func (s Scope) Title(lang language.Tag) string

Title returns string instance name for display

type Severity

type Severity int

Severity is severity for Base Metrics

const (
	SeverityUnknown Severity = iota
	SeverityNone
	SeverityLow
	SeverityMedium
	SeverityHigh
	SeverityCritical
)

Constant of severity

func (Severity) NameOfValue

func (sv Severity) NameOfValue(lang language.Tag) string

NameOfValue returns string name of value for display

func (Severity) String

func (sv Severity) String() string

func (Severity) Title

func (sv Severity) Title(lang language.Tag) string

Title returns string instance name for display

type UserInteraction

type UserInteraction int

UserInteraction is metric type for Base Metrics

const (
	UserInteractionUnknown UserInteraction = iota
	UserInteractionRequired
	UserInteractionNone
)

Constant of UserInteraction result

func GetUserInteraction

func GetUserInteraction(s string) UserInteraction

GetUserInteraction returns result of UserInteraction metric

func (UserInteraction) IsDefined

func (ui UserInteraction) IsDefined() bool

IsDefined returns false if undefined result value of metric

func (UserInteraction) NameOfValue

func (ui UserInteraction) NameOfValue(lang language.Tag) string

NameOfValue returns string name of value for display

func (UserInteraction) String

func (ui UserInteraction) String() string

func (UserInteraction) Title

func (ui UserInteraction) Title(lang language.Tag) string

Title returns string instance name for display

func (UserInteraction) Value

func (ui UserInteraction) Value() float64

Value returns value of UserInteraction metric

Jump to

Keyboard shortcuts

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