extractor/os/rpm: add Mageia ecosystem mapping#2199
Merged
copybara-service[bot] merged 2 commits intoJul 13, 2026
Conversation
Contributor
Author
|
PR submitted: #2199 |
Contributor
Author
|
Hi @michaelkedar, this PR implements the Mageia RPM ecosystem mapping for the accepted PRP #2177, same one-branch pattern as the merged AlmaLinux mapping in #2148. All checks pass. The E2E follow-up in osv-scanner#2873 depends on this landing first, since the scanner needs the Mageia to Mageia:9 mapping before it can surface MGASA advisories. Would appreciate a review when you have a moment. Thanks! |
herdiyana256
added a commit
to herdiyana256/osv-scanner
that referenced
this pull request
Jun 26, 2026
Add end-to-end test for scanning Mageia 9 container images to verify that the Mageia ecosystem mapping (added in google/osv-scalibr#2199) is correctly exercised by osv-scanner. Changes: - Add test-mageia-9.Dockerfile fixture based on mageia:9 (pinned to sha256:9f7cd063...) which contains bundled Python wheels with known PyPI vulnerabilities - Add TestCommand_OCIImage/Scanning_Mageia_9_image test case in command_test.go to scan the generated Mageia tarball - Add TestCommand_OCIImage_JSONFormat/scanning_mageia_9_image test case for JSON output format validation - Update snapshots and cassettes with successful scan results This follows the same pattern as the AlmaLinux E2E test (google#2870) as requested by @michaelkedar in google/osv-scalibr#2177. Tested via: make test ACC=true SNAPS=true SHORT=false TestCommand_OCIImage/Scanning_Mageia_9_image passes successfully.
herdiyana256
force-pushed
the
feature/os-mageia-ecosystem
branch
from
July 2, 2026 15:39
3eb2142 to
a16f55c
Compare
jess-lowe
approved these changes
Jul 9, 2026
Contributor
Author
|
@jess-lowe all checks green, approved, just blocked on protected branch merge. mind merging when you get a sec? |
Contributor
Author
|
@michaelkedar PR is approved by @jess-lowe and all 14 checks are green. Could you merge when you get a chance? Thanks! :) |
herdiyana256
added a commit
to herdiyana256/osv-scanner
that referenced
this pull request
Jul 13, 2026
Add end-to-end test for scanning Mageia 9 container images to verify that the Mageia ecosystem mapping (added in google/osv-scalibr#2199) is correctly exercised by osv-scanner. Changes: - Add test-mageia-9.Dockerfile fixture based on mageia:9 (pinned to sha256:9f7cd063...) which contains bundled Python wheels with known PyPI vulnerabilities - Add TestCommand_OCIImage/Scanning_Mageia_9_image test case in command_test.go to scan the generated Mageia tarball - Add TestCommand_OCIImage_JSONFormat/scanning_mageia_9_image test case for JSON output format validation - Update snapshots and cassettes with successful scan results This follows the same pattern as the AlmaLinux E2E test (google#2870) as requested by @michaelkedar in google/osv-scalibr#2177. Tested via: make test ACC=true SNAPS=true SHORT=false TestCommand_OCIImage/Scanning_Mageia_9_image passes successfully.
herdiyana256
added a commit
to herdiyana256/osv-scanner
that referenced
this pull request
Jul 13, 2026
…e image - Bump github.com/google/osv-scalibr to v0.4.6-0.20260713000915-500ad84f4ed1 which includes the Mageia ecosystem mapping fix (google/osv-scalibr#2199) - Update TestCommand_OCIImage_JSONFormat/scanning_mageia_9_image snapshot to reflect that the Mageia base image is now correctly detected (base_image_index updated, 'mageia' added to base_images list) - Update TestCommand_OCIImage_JSONFormat cassette with new API interaction order Fixes snapshot mismatch that caused CI failures on all platforms.
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