mod fix_cost¶
- module fix_cost¶
What each security finding costs to fix, two ways.
reportreads a scanner export and aRebuildDocumentfor the same installed stack. It does not walk the dependency graph again.A version bump is the patched module plus every installed reverse dependent. The module path changes, so the deployed stack is no longer the one that was built. That breaks reproducibility.
An in-place patch keeps the name and version and adds <Name>-<version>_<ID>.patch` to
patches`. It rebuilds the patched module, a bundle that includes the package as an extension or as a ``componentsentry, and a dependent that links it statically.
A runtime dependency is a shared-library link. A builddependency-only dependent is a static link when the recipe asks for a static build, or when
rebuild-setalready proved it from the install prefix. Otherwise the report says the link cannot be known, and that dependent is not counted in the in-place total.Variables
- const FIX_COST_SCHEMA_VERSION: u32¶
Schema of
FixCostDocument. Bumped when a field changes meaning.
- const ROUTE_BUMP: &str¶
Recommended route: take the new version and rebuild the closure.
- const ROUTE_DEFER: &str¶
Recommended route: do not backport.
- const ROUTE_IN_PLACE: &str¶
Recommended route: keep the version and add a patch file.
- const ROUTE_UNKNOWN: &str¶
The easyconfig is not in the deployed graph, so neither cost is known.
Functions
- fn render_markdown(document: &FixCostDocument) -> String¶
The ranked table and the roll-up as Markdown.
- fn render_tsv(document: &FixCostDocument) -> String¶
One line per finding, tab-separated, with a header.
- fn report(findings: &[Finding], installed: &BTreeSet<String>, document: &RebuildDocument, evidence: &EvidenceScan, reach: &ReachTable) -> FixCostDocument¶
Build the per-finding report from a rebuild set and recipe evidence.
evidencecomes fromscan_candidates. An empty scan still prices the graph: extensions and runtime edges are on the rebuild rows, and every builddependency-only dependent stays unknown.reachis the same tablerebuild-set --findingsuses forbackport.md.
-
fn scan_candidates<'a, I>(candidates: I, installed: &BTreeSet<String>) -> EvidenceScan¶
where
I: IntoIterator<Item = &'a Candidate>
¶ Read
candidatesin order. A later easyconfig filename replaces an earlier one, which is how afrom-committree replaces the release tree.
Enums
- enum LinkHint¶
What one recipe says about how it links, read from
configoptsandbuildopts.- Static¶
The recipe asks for a static build and not a shared one.
The recipe asks for a shared build and not a static one.
- Unknown¶
The recipe names both, or neither.
Structs and Unions
- struct BumpCost¶
The version-bump route.
- modules: usize¶
How many modules.
- fraction: f64¶
modules / stack_modules, four decimal places.
- names: Vec<String>¶
Module names, sorted.
- breaks_reproducibility: bool¶
A new version is a new module path. The deployed stack changes.
- struct EvidenceScan¶
Recipes read for
report, and paths that could not be read.- recipes: Vec<RecipeEvidence>¶
One entry per installed easyconfig that was read.
- notes: Vec<String>¶
Unreadable paths, and component entries whose version was not a literal.
- struct FindingRoute¶
One finding, with both costs and a route.
- vuln_id: String¶
Advisory id from the export.
- package: String¶
Package the scanner matched.
- version: String¶
Installed version from the export.
- severity: String¶
Worst severity among the export rows for this finding.
- fixed_in: String¶
Version that fixes it. Empty when the scanner names none.
- fix_state: String¶
fixed,not-fixed, or empty.
- reach: String¶
The class from
ReachTable:cross-user,network-facing,local-only,not-reachable, orunclassified.
- modules: Vec<String>¶
Installed modules that carry it, sorted.
- not_in_graph: Vec<String>¶
Installed modules named by the export whose easyconfig is not in the graph.
- patch_files: Vec<String>¶
<Name>-<version>_<ID>.patch, one per distinct name and version.
- bundles: Vec<String>¶
Bundles that ship the package as an extension or a component.
- static_linkers: Vec<String>¶
Dependents known to link the package statically.
- not_static: Vec<String>¶
Dependents known not to.
- static_unknown: Vec<String>¶
Builddependency-only dependents whose link cannot be known.
- recommended: String¶
ROUTE_IN_PLACE,ROUTE_BUMP,ROUTE_DEFER, orROUTE_UNKNOWN.
- reason: String¶
Why that route was chosen.
- struct FixCostDocument¶
Per-finding costs for one installed stack.
- schema_version: u32¶
FIX_COST_SCHEMA_VERSION.
- generated_at: String¶
When the rebuild set was computed.
- installed_source: String¶
Where the installed list came from.
- stack_modules: usize¶
Installed modules.
- rows: usize¶
Rows in the scanner export.
- findings: usize¶
Findings in
Self::ranked.
- ranked: Vec<FindingRoute>¶
One row per advisory, package, and version.
- rollup: FixCostRollup¶
What fraction of the stack each strategy rebuilds.
- not_installed: Vec<String>¶
Modules the export names that are not installed.
- not_in_graph: Vec<String>¶
Installed modules with a finding whose easyconfig is not in the graph.
- notes: Vec<String>¶
Unreadable recipes, and component versions that were not literals.
- struct FixCostRollup¶
Union of each strategy over every finding that has a closure.
- stack_modules: usize¶
Installed modules. This is the denominator.
- bump_modules: usize¶
Union of the bump closures.
- bump_fraction: f64¶
Self::bump_modulesoverSelf::stack_modules.
- in_place_modules: usize¶
Union of the in-place sets.
- in_place_fraction: f64¶
Self::in_place_modulesoverSelf::stack_modules.
- recommended_modules: usize¶
Union of the modules the recommended route rebuilds. A deferred finding contributes nothing.
- recommended_fraction: f64¶
Self::recommended_modulesoverSelf::stack_modules.
- static_unknown_modules: usize¶
Union of the dependents whose static link cannot be known.