cvssv3

package module
v0.0.0-...-79ce3fd Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2019 License: MIT Imports: 3 Imported by: 2

README

bunji2/cvssv3

A Common Vulnerability Scoring System Version 3.0 (CVSSv3) implementation for golang.

Inspired by "go-cvss" ( https://github.com/umisama/go-cvss ), but implementated in different way.

Installation

go get github.com/bunji2/cvssv3

Usage

import (
    "fmt"
    "github.com/bunji2/cvssv3"
)

func sample() {
    v, err := cvssv3.ParseVector(
        "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N")
    if err != nil {
        panic(err)
    }
    fmt.Printf("CVSS String: %s \n", v.String())
    fmt.Printf("Base Score: %4.1f \n", v.BaseScore())
    fmt.Printf("Temporal Score: %4.1f \n", v.TemporalScore())
    fmt.Printf("Environmental Score: %4.1f \n", v.EnvironmentalScore())
}

Document

Reference

License

under the MIT License

by Bunji2

Documentation

Overview

Package cvssv3 provides parsing and scoring with Common Vulunerability Scoring System version 3.0 (CVSSv3). Author: Bunji2 Inspired by "go-cvss" ( https://github.com/umisama/go-cvss ), but implementated in different way.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Vector

type Vector map[string]string

Vector reprecents a CVSS vector.

func ParseVector

func ParseVector(str string) (Vector, error)

ParseVector create new Vector object with str. str must valid as CVSS:3.0/base/temporal/environment Vector.

func (Vector) BaseScore

func (m Vector) BaseScore() float64

BaseScore returns m's base score.

func (Vector) EnvironmentalScore

func (m Vector) EnvironmentalScore() float64

EnvironmentalScore returns m's environmental score.

func (Vector) IsModifiedScopeChanged

func (m Vector) IsModifiedScopeChanged() bool

IsScopeChanged returns that whether m's Modified Scope is changed

func (Vector) IsScopeChanged

func (m Vector) IsScopeChanged() bool

IsScopeChanged returns that whether m's Scope is changed

func (Vector) Str

func (m Vector) Str(x string) string

Str(x) returns string value of m's metrics x

func (Vector) String

func (m Vector) String() string

String returns formatted m.

func (Vector) TemporalScore

func (m Vector) TemporalScore() float64

TemporalScore returns m's temporal score.

func (Vector) Val

func (m Vector) Val(x string) float64

Val(x) returns float value of m's metrics x

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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