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 ¶
- func AdjustSummary(severity string, summary *models.Summary)
- func FlattenVulnerabilities(packages []models.Package) []models.Vulnerability
- func GenerateFilename() string
- func MarkdownToHTML(results models.Results)
- func ParseSeverity(severity string) int
- func Rating(score float64) string
- func UniqueFieldValues[T any](input []T, fieldName string) []interface{}
- type Loader
- type Scanner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdjustSummary ¶ added in v0.3.0
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 GenerateFilename ¶ added in v0.5.0
func GenerateFilename() string
generateFilename generates a unique filename based on the current timestamp in the format "2006-01-02 15:04:05" and replaces certain characters to create a valid filename. The resulting filename is a combination of the timestamp and a fixed suffix. TODO: Need to make this generic. It's only being used for HTML Renderers
func MarkdownToHTML ¶ added in v0.5.0
markdownToHTML converts the Markdown descriptions of vulnerabilities in the given results to HTML. It uses the Blackfriday library to perform the conversion and sanitizes the HTML using Bluemonday.
func ParseSeverity ¶ added in v0.4.5
ParseSeverity takes a severity string and returns an int
func Rating ¶ added in v0.3.0
Rating takes a CVSS score as input and returns a rating string based on the score
func UniqueFieldValues ¶ added in v0.4.8
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 Scanner ¶ added in v0.4.8
type Scanner struct { SeveritySummary models.Summary Credentials models.Credentials Renderer models.Renderer Provider models.Provider Enrichment []string IgnoreFile string Severity string ExitCode bool Output string ProviderName string Version string Afs *afero.Afero }
Scanner represents a vulnerability scanner.