vulnerability

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Data source
	Nvd                   = "nvd"
	RedHat                = "redhat"
	Debian                = "debian"
	DebianOVAL            = "debian-oval"
	Ubuntu                = "ubuntu"
	CentOS                = "centos"
	Fedora                = "fedora"
	Amazon                = "amazon"
	Alpine                = "alpine"
	RubySec               = "ruby-advisory-db"
	RustSec               = "rust-advisory-db"
	PhpSecurityAdvisories = "php-security-advisories"
	NodejsSecurityWg      = "nodejs-security-wg"
	PythonSafetyDB        = "python-safety-db"
)

Variables

View Source
var (
	SeverityNames = []string{
		"UNKNOWN",
		"LOW",
		"MEDIUM",
		"HIGH",
		"CRITICAL",
	}
	SeverityColor = []func(a ...interface{}) string{
		color.New(color.FgCyan).SprintFunc(),
		color.New(color.FgBlue).SprintFunc(),
		color.New(color.FgYellow).SprintFunc(),
		color.New(color.FgHiRed).SprintFunc(),
		color.New(color.FgRed).SprintFunc(),
	}
)

Functions

func BatchUpdate

func BatchUpdate(fn func(b *bolt.Bucket) error) error

func ColorizeSeverity

func ColorizeSeverity(severity string) string

func CompareSeverityString

func CompareSeverityString(sev1, sev2 string) bool

func Get

func Get(cveID string) (map[string]Vulnerability, error)

func Put

func Put(tx *bolt.Tx, cveID, source string, vuln Vulnerability) error

func Update

func Update(cveID, source string, vuln Vulnerability) error

Types

type Advisory

type Advisory struct {
	VulnerabilityID string
	FixedVersion    string
}

type DetectedVulnerability

type DetectedVulnerability struct {
	VulnerabilityID  string
	PkgName          string
	InstalledVersion string
	FixedVersion     string

	Title       string
	Description string
	Severity    string
	References  []string
}

func FillAndFilter

func FillAndFilter(vulns []DetectedVulnerability, severities []Severity, ignoreUnfixed bool) []DetectedVulnerability

type LastUpdated

type LastUpdated struct {
	Date time.Time
}

type Severity

type Severity int
const (
	SeverityUnknown Severity = iota
	SeverityLow
	SeverityMedium
	SeverityHigh
	SeverityCritical
)

func NewSeverity

func NewSeverity(severity string) (Severity, error)

func (Severity) String

func (s Severity) String() string

type Vulnerability

type Vulnerability struct {
	ID          string // e.g. CVE-2019-8331, OSVDB-104365
	CvssScore   float64
	CvssScoreV3 float64
	Severity    Severity
	SeverityV3  Severity
	References  []string
	Title       string
	Description string
}

Jump to

Keyboard shortcuts

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