types

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CVEToleration

type CVEToleration struct {
	ID        string
	Statement string
	ExpiresAt *time.Time
}

CVEToleration represents the canonical CVE toleration type. This is the single source of truth for toleration data structures.

type ToleratedCVE

type ToleratedCVE struct {
	CVEID       string
	Statement   string
	ToleratedAt time.Time
	ExpiresAt   *time.Time // Nil means no expiry
}

ToleratedCVE extends CVEToleration with tracking metadata for storage. Used by StateStore to record when and where tolerations were applied. Note: This uses explicit fields instead of embedding to match statestore naming conventions.

func FilterToleratedCVEs

func FilterToleratedCVEs(
	tolerations []CVEToleration,
	toleratedSet map[string]bool,
	toleratedAt time.Time,
) []ToleratedCVE

FilterToleratedCVEs filters tolerations based on a set of tolerated IDs. Only tolerations whose IDs are in the toleratedSet will be included.

type TolerationInfo

type TolerationInfo struct {
	CVEID       string
	Statement   string
	ToleratedAt time.Time
	ExpiresAt   *time.Time
	Repository  string
}

TolerationInfo extends ToleratedCVE with repository context for queries. Used by StateStore queries to show which repositories have which tolerations. Note: This uses explicit fields instead of embedding to match statestore naming conventions.

type Vulnerability

type Vulnerability struct {
	ID           string // CVE ID
	Severity     string // CRITICAL, HIGH, MEDIUM, LOW
	PackageName  string
	Version      string // Installed version
	FixedVersion string // Version with fix (empty if no fix available)
	Title        string
	Description  string
	PrimaryURL   string // Reference URL
}

Vulnerability represents the canonical vulnerability type used across the application. This is the single source of truth for vulnerability data structures.

type VulnerabilityRecord

type VulnerabilityRecord struct {
	CVEID            string // CVE ID
	Severity         string // CRITICAL, HIGH, MEDIUM, LOW
	PackageName      string
	InstalledVersion string // Installed version
	FixedVersion     string // Version with fix (empty if no fix available)
	Title            string
	Description      string
	PrimaryURL       string // Reference URL
	// Image context
	Repository string
	Tag        string
	Digest     string
	ScannedAt  time.Time
}

VulnerabilityRecord extends Vulnerability with image context for storage. Used by StateStore to track which images contain which vulnerabilities. Note: This uses explicit fields instead of embedding to match statestore naming conventions.

func ToVulnerabilityRecord

func ToVulnerabilityRecord(
	vuln Vulnerability,
	repository, tag, digest string,
	scannedAt time.Time,
) VulnerabilityRecord

ToVulnerabilityRecord converts a Vulnerability to a VulnerabilityRecord with image context.

Jump to

Keyboard shortcuts

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