lib

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package lib contains core functionality to load Software Bill of Materials and contains common functions

Package lib contains core functionality to load Software Bill of Materials and contains common functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjustSummary added in v0.3.0

func AdjustSummary(severity string, summary *models.Summary)

AdjustSummary takes a severity string and a pointer to a Summary struct as input, and increments the corresponding severity count in the struct.

func FlattenVulnerabilities added in v0.4.7

func FlattenVulnerabilities(packages []models.Package) []models.Vulnerability

FlattenVulnerabilities flattens all vulnerabilities for a package

func ParseSeverity added in v0.4.5

func ParseSeverity(severity string) int

ParseSeverity takes a severity string and returns an int

func Rating added in v0.3.0

func Rating(score float64) string

Rating takes a CVSS score as input and returns a rating string based on the score

func UniqueFieldValues added in v0.4.8

func UniqueFieldValues[T any](input []T, fieldName string) []interface{}

UniqueFieldValues returns a slice of unique field values from a slice of structs given a field name

Types

type Loader added in v0.4.8

type Loader struct {
	Afs *afero.Afero
}

func (*Loader) Load added in v0.4.8

func (l *Loader) Load(args []string) (scanned []models.ScannedFile, purls []string, licenses []string, err error)

Load retrieves a slice of Purls from various types of SBOMs

func (*Loader) LoadIgnore added in v0.4.8

func (l *Loader) LoadIgnore(ignoreFile string) (cves []string, err error)

LoadIgnore loads a list of CVEs entered one on each line from the filename

type Scanner added in v0.4.8

type Scanner struct {
	SeveritySummary models.Summary
	Credentials     models.Credentials
	Renderer        models.Renderer
	Provider        models.Provider
	IgnoreFile      string
	Severity        string
	ExitCode        bool
	Output          string
	ProviderName    string
	Version         string
	Afs             *afero.Afero
}

Scanner represents a vulnerability scanner.

func (*Scanner) Scan added in v0.4.8

func (s *Scanner) Scan(args []string) (exitCode int, err error)

Scan performs the vulnerability scan.

Directories

Path Synopsis
Package enrichment provides functionality to enrich vulnerabilities with epss data.
Package enrichment provides functionality to enrich vulnerabilities with epss data.
Package filters provides functionality to filter vulnerability output
Package filters provides functionality to filter vulnerability output

Jump to

Keyboard shortcuts

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