Repository navigation
feat: local advisory feeds and policies - #47
Merged
Merged
Conversation
5 tasks done
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.
Summary
The last point of #37, done the way Hugo chose: the analysis stays offline and deterministic, advisories come from a local file imported once from a public dump.
test: define local advisory feeds and dependency policies), implementation follows.dependency/advisories.py:read_osvwalks a JSON file, a directory of them or a zip archive;import_osvkeeps the PyPI records and turns each range of events (introduced,fixed,last_affected) into a version specifier, with the summary, the GHSA/CVE aliases and the severity fromdatabase_specific;dump_advisories/load_advisoriesread and write a small versionedadvisories.json. OSV names no affected APIs, so imported advisories feed the requirement checks and the SBOM; a local entry completed withaffected_symbolsfeeds reachability and correlation too.advisories.jsonat the root and the files passed with--advisories, merges them with plugin advisories by identifier, package and range, the local file winning; workers reload the same files. Unreadable files becomesyntax-errornotes, like dependency files.dependency/policy.pyand the shippeddependency-policyproject plugin:coretrace-policy.tomlat the root or--policy FILEdenies packages (denied-dependency, high), requires pins (unpinned-dependency, low) and lists accepted advisories, whose findings are dropped whatever produced them.ProjectContextexposes the policy.--import-advisories SRC OUTconverts a dump and exits; the positional path is optional for that action only.Closes #37