reposcan

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package reposcan checks the image references in a source tree and plans the fix for each vulnerable one. It is the library entry point for repository scans: the CLI's repo and fix modes and DefectDojo Sensei both call Run.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Result repocheck.Result `json:"result"`
	// Change is the verified edit that fixes it, when one exists.
	Change *fix.Change `json:"change,omitempty"`
	// Decline says why there is no edit, for a vulnerable reference without one.
	Decline *fix.Decline `json:"decline,omitempty"`
}

Item is one reference that proves a PHP version, with its fix plan.

func Run

func Run(ctx context.Context, root string, opts Options) (*report.Target, []Item, error)

Run scans root and returns the report target and an item per PHP reference. When a registry failed for some references, Run still returns the target and items it has, with a *TransientError.

type Options

type Options struct {
	Registry registry.Options
	Refs     refs.Options
	// Parallel is how many references are resolved at once (default 4).
	Parallel int
	// Files limits the scan to these repository-relative files (a PR's changed
	// files); empty scans the whole tree.
	Files []string
	// NoPlan skips fix planning (no tag listing).
	NoPlan bool
	// MaxImages caps the distinct image references resolved (default 200), so a
	// repository cannot make one scan spend a registry's rate limit for everyone.
	// References past the cap are listed as not checked.
	MaxImages int
}

Options configure a repository scan.

type TransientError

type TransientError struct{ Refs []string }

TransientError reports image references that could not be checked because a registry failed (network, timeout, rate limit). A scan with any of these is incomplete in a way the next run can fix, so callers must not treat its (shorter) findings list as the truth: a reimport would close open findings.

func (*TransientError) Error

func (e *TransientError) Error() string

Jump to

Keyboard shortcuts

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