fixplan

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fixplan runs once after the engine barrier and the location sort: it sets the fix plan of every finding (live, dead, unverified and suppressed alike). Build is the single plan implementation; the default stage adapter and the public tokenhound.FixPlan both call it. A plan is ordered revoke, replace, purge (only with a commit or image location), check usage and ScopeKeeper (always last). It holds links and commands only, makes no network call and never reads key material: the purge pattern comes from the redacted form, the length and the registry pattern.

Index

Constants

View Source
const (
	// Noop is the name of the adapter that plans nothing.
	Noop = "noop"
	// Default is the name of the adapter that sets every finding's plan with Build.
	Default = "default"
)

Adapter names.

Variables

This section is empty.

Functions

func Build added in v0.2.0

func Build(f model.Finding, reg *registry.Registry) *model.FixPlan

Build returns the fix plan of f: revoke, replace, purge (only when a location is a commit or an image layer), check usage and ScopeKeeper, numbered from 1. It is pure: it reads only f and reg, never key material beyond the redacted forms, and makes no network call. reg may be nil; the plan then has no registry links.

func Register

func Register(name string, f Factory)

Register adds a fixplan adapter. Adapters call it from init().

Types

type Factory

type Factory func(Options) (FixPlanner, error)

Factory builds a FixPlanner.

func Lookup

func Lookup(name string) (Factory, bool)

Lookup returns the fixplan adapter registered under name.

type FixPlanner

type FixPlanner interface {
	Plan(f *model.Finding)
}

FixPlanner is the fixplan stage interface. Plan sets only the Finding's FixPlan.

type Options

type Options struct {
	// Registry supplies provider links, env var names, key patterns, surfaces and the
	// ScopeKeeper link.
	Registry *registry.Registry
}

Options configures a fix planner.

Jump to

Keyboard shortcuts

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