plan

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionPlan

type ActionPlan struct {
	TemplateID     string   `json:"templateId" yaml:"templateId"`
	TargetPackage  string   `json:"targetPackage" yaml:"targetPackage"`
	CurrentVersion string   `json:"currentVersion,omitempty" yaml:"currentVersion,omitempty"`
	TargetVersion  string   `json:"targetVersion,omitempty" yaml:"targetVersion,omitempty"`
	FixedCVEs      []string `json:"fixedCves,omitempty" yaml:"fixedCves,omitempty"`
}

ActionPlan summarizes a single remediation action on a host.

type Finding

type Finding struct {
	CVEID          string `json:"cveId" yaml:"cveId"`
	PackageName    string `json:"packageName" yaml:"packageName"`
	CurrentVersion string `json:"currentVersion,omitempty" yaml:"currentVersion,omitempty"`
}

Finding describes a single vulnerability on a host.

type HostPlan

type HostPlan struct {
	Host    inventory.Host  `json:"host" yaml:"host"`
	Actions []ActionPlan    `json:"actions" yaml:"actions"`
	Summary HostPlanSummary `json:"summary" yaml:"summary"`
}

HostPlan contains all remediation actions for a host.

type HostPlanOptions

type HostPlanOptions struct {
	Host     inventory.Host
	Findings []Finding
}

HostPlanOptions describes a host level planning request.

type HostPlanSummary

type HostPlanSummary struct {
	TotalFindings     int `json:"totalFindings" yaml:"totalFindings"`
	DistinctCVEsFixed int `json:"distinctCvesFixed" yaml:"distinctCvesFixed"`
	ActionsCount      int `json:"actionsCount" yaml:"actionsCount"`
}

HostPlanSummary captures counts for a host plan.

type Plan

type Plan struct {
	CVEID      string         `json:"cveId" yaml:"cveId"`
	TemplateID string         `json:"templateId" yaml:"templateId"`
	Host       inventory.Host `json:"host" yaml:"host"`
	Parameters map[string]any `json:"parameters" yaml:"parameters"`

	Preflight  []ovrs.Check `json:"preflight" yaml:"preflight"`
	Steps      []ovrs.Step  `json:"steps" yaml:"steps"`
	Validation []ovrs.Check `json:"validation" yaml:"validation"`

	RenderedPreflight  []ovrs.Check `json:"renderedPreflight,omitempty" yaml:"renderedPreflight,omitempty"`
	RenderedSteps      []ovrs.Step  `json:"renderedSteps,omitempty" yaml:"renderedSteps,omitempty"`
	RenderedValidation []ovrs.Check `json:"renderedValidation,omitempty" yaml:"renderedValidation,omitempty"`

	RenderWarnings []string `json:"renderWarnings,omitempty" yaml:"renderWarnings,omitempty"`

	TargetPackage   string   `json:"targetPackage,omitempty" yaml:"targetPackage,omitempty"`
	CurrentVersion  string   `json:"currentVersion,omitempty" yaml:"currentVersion,omitempty"`
	TargetVersion   string   `json:"targetVersion,omitempty" yaml:"targetVersion,omitempty"`
	FixedCVEs       []string `json:"fixedCves,omitempty" yaml:"fixedCves,omitempty"`
	FixedCVEsSource string   `json:"fixedCvesSource,omitempty" yaml:"fixedCvesSource,omitempty"`
}

Plan is a minimal rendering of how to remediate a CVE on a host.

type PlanOptions

type PlanOptions struct {
	CVEID string
	Host  inventory.Host
}

PlanOptions captures the request to plan a single CVE for a host.

type Planner

type Planner struct {
	Templates       []*ovrs.Template
	CveMappings     []*kb.CveMapping
	PackageReleases []*kb.PackageRelease
}

Planner provides simple plan generation over in-memory data.

func (*Planner) PlanForHostFindings

func (p *Planner) PlanForHostFindings(opts HostPlanOptions) (*HostPlan, error)

PlanForHostFindings groups findings by package and creates package-level actions.

func (*Planner) PlanForSingleCVE

func (p *Planner) PlanForSingleCVE(opts PlanOptions) (*Plan, error)

PlanForSingleCVE finds the first matching mapping/template and produces a plan.

Jump to

Keyboard shortcuts

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