extractor/os/rpm: add Mageia ecosystem mapping#2199
Open
herdiyana256 wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
PR submitted: #2199 |
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 #2177
Problem
Currently, when OSV-SCALIBR extracts RPM packages from a Mageia distribution, the
*rpmmeta.Metadataswitch inextractor/filesystem/os/ecosystem/ecosystem.godoes not recognize themageiaOSID. As a result, it falls through to the default behavior and returns an empty ecosystem namespace.This prevents OSV-SCALIBR from matching any extracted packages against the 5,941+ official Mageia security advisories tracked on OSV.dev. None of these advisories are reachable today because the ecosystem is never correctly set.
Examples of critical but undetected advisories due to this missing mapping:
Solution
This PR adds support for mapping Mageia RPM packages to the correct OSV.dev ecosystem:
m.OSID == "mageia"inecosystem.gowhich explicitly returnsosvconstants.EcosystemMageia.m.OSVersionIDas the suffix to capture the major version correctly (e.g.Mageia:9), matching the taxonomy of OSV.dev advisories.Mageia_9,Mageia_8, andMageia_no_version) inecosystem_test.goto validate parsing.docs/supported_inventory_types.md) to reflect that the RPM extractor now supports Mageia.Note: E2E tests for the Mageia ecosystem will follow as a separate PR in the
osv-scannerrepository (similar to the AlmaLinux follow-up pattern ingoogle/osv-scanner#2870).Before / After
Before:
pkg:rpm//openssl@3.0.8-1.mga9← namespace empty, zero MGASA matchesAfter:
pkg:rpm/mageia/openssl@3.0.8-1.mga9(ecosystem:Mageia:9)Verification