kb

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Applicability

type Applicability struct {
	Ecosystems     []string `yaml:"ecosystems" json:"ecosystems"`
	OSFamilies     []string `yaml:"osFamilies" json:"osFamilies"`
	Distributions  []string `yaml:"distributions" json:"distributions"`
	OSVersionRange string   `yaml:"osVersionRange" json:"osVersionRange"`
	Architectures  []string `yaml:"architectures" json:"architectures"`
}

type CveMapping

type CveMapping struct {
	CVEID         string         `yaml:"cveId" json:"cveId"`
	TemplateID    string         `yaml:"templateId" json:"templateId"`
	Parameters    map[string]any `yaml:"parameters" json:"parameters"`
	Applicability Applicability  `yaml:"applicability" json:"applicability"`
	Notes         string         `yaml:"notes" json:"notes"`
	Source        SourceInfo     `yaml:"source" json:"source"`
	SourcePath    string         `yaml:"-" json:"-"`
}

func LoadCveMappingsFromDir

func LoadCveMappingsFromDir(root string) ([]*CveMapping, error)

LoadCveMappingsFromDir loads all CVE mappings from YAML files under a directory.

func (*CveMapping) Validate

func (m *CveMapping) Validate() []error

Validate ensures the CVE mapping has required fields.

type Dependency added in v0.2.0

type Dependency struct {
	Name      string `yaml:"name" json:"name"`
	Version   string `yaml:"version" json:"version"`
	Ecosystem string `yaml:"ecosystem" json:"ecosystem"`
}

Dependency represents a direct dependency of a package version. Used for transitive shadow analysis.

type PackageRelease

type PackageRelease struct {
	PackageName  string       `yaml:"packageName" json:"packageName"`
	Version      string       `yaml:"version" json:"version"`
	Ecosystem    string       `yaml:"ecosystem" json:"ecosystem"`
	OSFamily     string       `yaml:"osFamily" json:"osFamily"`
	Distribution string       `yaml:"distribution" json:"distribution"`
	Release      string       `yaml:"release" json:"release"`
	Architecture string       `yaml:"architecture" json:"architecture"`
	FixesCVEs    []string     `yaml:"fixesCves" json:"fixesCves"`
	HasCVEs      []string     `yaml:"hasCves" json:"hasCves"`
	Dependencies []Dependency `yaml:"dependencies" json:"dependencies"`
	Source       SourceInfo   `yaml:"source" json:"source"`
	SourcePath   string       `yaml:"-" json:"-"`
}

func LoadPackageReleasesFromDir

func LoadPackageReleasesFromDir(root string) ([]*PackageRelease, error)

LoadPackageReleasesFromDir loads all package releases from YAML files under a directory.

func (*PackageRelease) Validate

func (p *PackageRelease) Validate() []error

Validate ensures the package release has required fields.

type SourceInfo

type SourceInfo struct {
	Kind       string `yaml:"kind" json:"kind"`
	Reference  string `yaml:"reference" json:"reference"`
	ImportedAt string `yaml:"importedAt" json:"importedAt"`
}

Jump to

Keyboard shortcuts

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