cvss

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

README

go-cvss - Common Vulnerability Scoring System (CVSS) Version 3

Build Status GitHub license GitHub release

Install

$ go get -u github.com/spiegel-im-spiegel/gpgpdump
Usage
m := cvssv3.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

ref: sample.go

Bookmark

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUndefinedMetric = errors.New("undefined metric")
	ErrInvalidVector   = errors.New("invalid vector")
	ErrNotSupportVer   = errors.New("not support version")
)

Error instances

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
v3

Jump to

Keyboard shortcuts

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