feat: add RapidFort vulnerability provider#1114
Open
vaibhav-rf wants to merge 7 commits intoanchore:mainfrom
Open
feat: add RapidFort vulnerability provider#1114vaibhav-rf wants to merge 7 commits intoanchore:mainfrom
vaibhav-rf wants to merge 7 commits intoanchore:mainfrom
Conversation
Signed-off-by: Vaibhav Thatai <[email protected]>
Signed-off-by: Vaibhav Thatai <[email protected]>
Signed-off-by: Vaibhav Thatai <[email protected]>
Signed-off-by: Vaibhav Thatai <[email protected]>
- Extend rapidfort parser for Red Hat OS advisories - Update unit tests and add rapidfort-redhat:el9 snapshot + input fixtures Signed-off-by: Vaibhav Thatai <[email protected]>
- Remove unused GitRevision dataclass (copy-paste from ubuntu, never used) - Fix _events_to_range_pairs called twice per CVE: pass pre-computed range_pairs to _build_fixed_in_elements instead of recomputing - Add alpine/apk fixture + snapshot (third OS type was untested) - Correct snapshots: VendorAdvisory was missing, breaking snapshot test - Add tests for _merge_into_namespace, _map_severity, and fc37 VendorAdvisory Signed-off-by: Vaibhav Thatai <[email protected]>
2726aa2 to
487c8be
Compare
The outer advisory key is the OS version (9), not the release identifier (el9). Corrects the test fixture, unit test, and snapshot to produce the rapidfort-redhat:9 namespace that matches real advisory data and grype's expectations. Signed-off-by: Vaibhav Thatai <[email protected]>
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.
feat: add RapidFort vulnerability provider
Summary
Adds a new
rapidfortprovider that ingests security advisory data from theRapidFort security-advisories
GitHub repository and normalizes it into vunnel's OSSchema format for consumption
by Grype.
RapidFort advisories are intended for use when scanning RapidFort-curated images
(identified via maintainer metadata) to apply RapidFort-specific version checks
that differ from upstream distro advisories.
What's included
New provider —
src/vunnel/providers/rapidfort/__init__.pyProviderandConfigclasses; registered in the global provider registryparser.pygit.py--depth=1) with retry-backoff for the advisory repoSupported OS types and version formats:
dpkgrapidfort-ubuntu:22.04apkrapidfort-alpine:3.15rpmrapidfort-redhat:el9Namespace isolation: advisories are stored under
rapidfort-{os}:{version}(e.g.
rapidfort-ubuntu:20.04) so Grype keeps them separate from standardupstream distro scans.
Key design decisions
introduced/fixedpair in an advisory event becomes a separate
FixedInentry with aVulnerableRangefield. A single CVE can produce multipleFixedInentrieswhen it affects more than one release branch.
el9,fc36) that are preserved in theIdentifierfield and reflected inVendorAdvisory.AdvisorySummary.fixdatesystem to populatethe
Availablefield on eachFixedInentry.FixedInentries are merged into a single vulnerability record.Registration
src/vunnel/providers/__init__.py— provider added to the global registrysrc/vunnel/cli/config.py—Configadded to theProvidersdataclass forCLI/YAML configuration
Tests —
tests/unit/providers/rapidfort/TestEventsToRangePairsTestNormalizeFixedInentries;Availablefield present; Red Hat per-range identifiers andVendorAdvisoryTestMergeIntoNamespaceTestMapSeverityUnknownforNone, empty string, unrecognized valuestest_provider_schemaschema-1.1.0.jsontest_provider_via_snapshotTest fixtures cover all three supported OS types:
Test plan
pytest tests/unit/providers/rapidfort/— all 17 tests passvunnel run rapidfortclones the advisory repo and writes resultsvunnel listshowsrapidfortin the provider listrapidfort-ubuntu:*/rapidfort-alpine:*/rapidfort-redhat:*namespaces when scanning RapidFort-curated images