Repository navigation
feat: write an OpenVEX document justified by reachability - #126
Merged
Merged
Conversation
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #97.
--vex PATHwrites an OpenVEX 0.2.0 document on a directory check, next to--sbom. It has one statement per advisory affecting a requirement, with the required package as a subcomponent of the project.Statuses
affectedreachableorexploitable. This includes findings the policy accepts or an inline comment suppresses, since accepting a risk does not make the project unaffected.status_noteslists every place with its highest level.action_statementnames the package and its vulnerable range.not_affectedvulnerable_code_not_in_execute_path, only when all four conditions hold: (1) the advisory names entry points; (2) nothing reaches them; (3) every file and function was analysed; (4) a lock file shows that no other package requires the vulnerable one. Theimpact_statementnames the entry points, plus any calls ruled out by their arguments.under_investigationstatus_notessays which condition failed: no entry point, files not fully analysed (named), no lock file, or the packages that require the vulnerable one.This differs from the issue text in two places, both on purpose:
not_affectedwhenever there is noreachable-vulnerabilityfinding. But the engine reads the project's code, not the code of installed packages. A framework calling the vulnerable function on the project's behalf would be missed, and the claim would be false. On luigi, httplib2 (CVE-2026-59939) is never called by luigi's own code, butgoogle-api-python-clientandgoogle-auth-httplib2require it. It now comes outunder_investigation, naming both.--vex PATH, not a fourth--format. VEX describes dependencies, like the SBOM, not the findings of a report. A separate file lets one run produce SARIF, an SBOM and VEX together.Supporting changes
uv.lockandpoetry.locknow record which packages require which:DependencyGraph.required_by(name)gives the other packages requiring a package. Optional extras and development groups count. The project's own packages (uv's editable or virtual sources inside the tree, such as luigi'seditable = ".") do not. An editable package outside the tree does count. It returns None when no lock file mentions the package.ProjectAnalysis.acceptedkeeps the findings of advisories the policy accepts.Policy.accepts(finding)is the single predicate behind it and behindapply_policy.@idsits in OpenVEX's shared namespace and derives from the statements, not the timestamp, so two runs with the same result share it. TheauthorisUnknown Author, as govulncheck writes when it cannot know it. The product must be an IRI, so it ispkg:generic/<directory>.Verification
pytest: 991 passed.pytest -m regressionunder Python 3.12: 19 passed, snapshots unchanged.ruff check src testsandmypyare clean.@id. The lock-file parsing was mutation-checked the same way: extras, merge union, the project's own packages, an editable package outside the tree.Not done
--vex-productoption, for a pipeline that must match a container image or a published package, can come when a scanner needs it.