Skip to content

Conversation

willmurphyscode
Copy link
Contributor

This is part of work for anchore/grype#2745

This is a workaround necessitated by the approached taken in anchore/vunnel#826. That PR makes the vunnel RHEL provider sometimes emit AlmaLinux vulns in addition to RHEL vulns, which Grype DB previously had no code to handle.

@willmurphyscode willmurphyscode marked this pull request as ready for review August 19, 2025 17:18
@willmurphyscode willmurphyscode force-pushed the allow-alma-from-rhel branch 2 times, most recently from c48aeaa to 1307a73 Compare August 21, 2025 20:23
@willmurphyscode willmurphyscode changed the title allow for the RHEL provider to emit Alma vulnerabilities as well move sample data into grype-db project; conditionally emit almalinux->rhel alias on absence of almalinux specific data Aug 28, 2025
}

// populateInitialOverrides populates the database with initial OS and package specifier overrides
func (w *writer) populateInitialOverrides() error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note to self: does this do anything to remove aliases put in by grype in https://github.com/anchore/grype/blob/main/grype/db/v6/data.go#L10? Need to think about release safety - should be able to go out before or after corresponding grype change.

Because it is unknown at compile time whether running `grype-db pull`
will execute a RHEL provider that emits AlmaLinux vulnerabilities as
well, and because if grype has neither the AlmaLinux specific
vulnerabilities nor the alias, matching on AlmaLinux systems will be
very incorrect, detect and db build time whether there are AlmaLinux
vulnerabilities present and emit the AlmaLinux->RHEL alias if they are
not.

Signed-off-by: Will Murphy <[email protected]>
Otherwise, for grype-db to conditionally add aliases, such as aliasing
almalinux to RHEL if no almalinux data is available from Vunnel,
grype-db will be modifying hard-coded data that exists in grype.

Signed-off-by: Will Murphy <[email protected]>
This is a cleaner implementation, rather than writing the alias data
initially and then correcting it, just write it once, late enough in the
build that alma vulnerabilities will already be in the database or not.

Signed-off-by: Will Murphy <[email protected]>
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.

1 participant