Skip to content

Honoring RHEL minor release and stream when doing CPE mapping - #184

Merged
Mab879 merged 3 commits into
ComplianceAsCode:mainfrom
vojtapolasek:fix/rhel-eus-cpe-selection
Oct 20, 2026
Merged

Mab879 merged 3 commits into
ComplianceAsCode:mainfrom
vojtapolasek:fix/rhel-eus-cpe-selection

Conversation

@vojtapolasek

Copy link
Copy Markdown
Collaborator

Until now, when creating a CPE catalog to map installed packages through CPEs to CVEs, there was some ambiguity when there were CPEs for multiple RHEL minor releases.
This fix does not modify the package mapping (no new packages will be probably mapped), but it improves precision of the mapping.
A CVE might be fixed for example in RHEL 9.6, but not in RHEL 9.0.
This was not honored or at least not determinisitcally in the current state before this PR.
See commits for explanation of what is being done.

Keep the automatic root-catalog scan as a smoke test, and use a small explicit catalog keyed by the installed fixture NEVRA for the synthetic matcher assertion. This separates catalog generation from matcher behavior and avoids repository/image version drift making the assertion flaky.
Resolve the effective RHEL release for host and automatic scans, select
only its EUS CPE, and fail closed when the mapping or target minor
version is incomplete.
Select target CPEs from Red Hat's __<major>_DOT_<minor> entries, including architecture-suffixed entries. This covers EUS, E4S, AUS, TUS, and Extended EUS where those entries are published. Keep non-stream mappings unchanged and fail closed for E6S until Red Hat adds version-specific entries.

@Mab879 Mab879 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some improvements needed, but that can be done in a later PR.

@Mab879
Mab879 merged commit 2aa8bbd into ComplianceAsCode:main Oct 20, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants