v3

package
v1.3.1 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: 3 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CVSS

type CVSS struct {
	Base *base.Metrics
}

CVSS is type of CVSS

Example
m := New()
if err := m.ImportBaseVector("CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"); err != nil {
	fmt.Fprintln(os.Stderr, err)
	return
}
severity := m.Base.GetSeverity()
fmt.Printf("%s: %v (%.1f)\n\n", severity.Title(language.English), severity, m.Base.Score())
if r, err := m.Base.Report(nil, language.English); err != nil { //output with CSV format
	fmt.Fprintln(os.Stderr, err)
} else {
	_, _ = io.Copy(os.Stdout, r)
}
Output:

Severity: Critical (9.9)

Base Metrics,Metric Value
Attack Vector,Network
Attack Complexity,Low
Privileges Required,Low
User Interaction,None
Scope,Changed
Confidentiality Impact,High
Integrity Impact,High
Availability Impact,High

func New

func New() *CVSS

New returns CVSS instance

func (*CVSS) ImportBaseVector

func (c *CVSS) ImportBaseVector(v string) error

ImportBaseVector imports CVSSv3.0 base metrics vector

func (*CVSS) Title

func (c *CVSS) Title(lang language.Tag) string

Title returns string instance name for display

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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