vulns

package
v2.3.7 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package vulns provides utility functions for working with vulnerabilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AffectsEcosystem

func AffectsEcosystem(v *osvschema.Vulnerability, ecosystemAffected osvecosystem.Parsed) bool

func GetFixedVersions

func GetFixedVersions(v *osvschema.Vulnerability) map[PackageKey][]string

GetFixedVersions returns a map of fixed versions for each package, or a map of empty slices if no fixed versions are available

func Include

func Include(vs []*osvschema.Vulnerability, vulnerability *osvschema.Vulnerability) bool

func IsAffected

func IsAffected(v *osvschema.Vulnerability, pkg *extractor.Package) bool

func NormalizeRepo added in v2.2.4

func NormalizeRepo(repo string) string

NormalizeRepo applies some reasonable transformations to repository urls to ensure accurate results when determining if two repository urls are referencing the same repository.

Specifically, common protocols are removed from the start of the url and the ".git" suffix if present

Types

type PackageKey added in v2.3.0

type PackageKey struct {
	Name      string
	Ecosystem string
	Purl      string
}

PackageKey uniquely identifies a package in a vulnerability.

func NewPackageKey added in v2.3.0

func NewPackageKey(pkg *osvschema.Package) PackageKey

NewPackageKey creates a PackageKey from osvschema.Package.

Jump to

Keyboard shortcuts

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