Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@chait-slim
Copy link

  • Add common helper functions to identify Root.io patched packages
  • Implement filtering logic to remove false positives for .root.io versions
  • Integrate filtering into APK, DPKG, and Python matchers
  • Add comprehensive unit tests for filtering logic

Packages with .root.io in their version string are patched by Root.io
and should not report vulnerabilities marked as ROOTIO_UNAFFECTED.

Signed-off-by: Chai Tadmor [email protected]

return matches
}

// Root.io packages with .root.io versions have been patched by Root.io
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't right - you should be actually searching the database for fixes that the vunnel and grype-db work have put there.

Add database-driven filtering for Root.io patched packages by querying
UnaffectedPackageHandle entries from grype-db. This implements the
reviewer's requirement to search the database for fixes from vunnel and
grype-db.

Key changes:
 - Add FindUnaffectedPackages() to vulnerability.Provider interface
 - Implement database querying in vulnerability_provider.go
 - Create UnaffectedPackage model with constraint validation
 - Add RootIOCriteria for Root.io-specific OS queries using rootio-{distro}
 - Implement FilterRootIoUnaffectedMatches() with database queries
 - Filter vulnerabilities selectively per CVE with constraint checking
 - Integrate filtering into APK, DPKG, and Python matchers
 - Add comprehensive unit tests for database-driven filtering

The implementation queries the unaffected_package_handles table populated
by grype-db, validates version constraints per CVE, and only filters
vulnerabilities that Root.io has actually patched.
@chait-slim chait-slim force-pushed the feat/rootio-unaffected-filtering branch from 5739e82 to 921b361 Compare November 23, 2025 13:33
}

func FilterRootIoUnaffectedMatchesForLanguage(store vulnerability.Provider, p pkg.Package, language string, matches []match.Match) []match.Match {
return FilterRootIoUnaffectedMatches(store, p, matches)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused. Is the language parameter ignored? Why?

DistroVersion: p.Distro.VersionString(),
}

unaffectedPkgs, err := store.FindUnaffectedPackages(p, rootIOCriteria)
Copy link
Contributor

Choose a reason for hiding this comment

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

The store already has a method to search for unaffected packages.

@willmurphyscode
Copy link
Contributor

Hi @chait-slim! Thanks for addressing the feedback.

A couple things:

First: I think we'd benefit from a call to talk about this new vulnerability data and how it should work with Grype - I am trying to give sort of high level feedback in GitHub comments and I think some context is being lost. Can you make an appointment with me at https://calendar.app.google/vtAP61H34Cu4QQWq7 ? Please include anyone who can answer questions about the semantics of the vulnerability data. Thanks!

Second: the PRs are failing the DCO check. See https://github.com/anchore/grype/blob/main/CONTRIBUTING.md#sign-off-your-work for some info on how to fix this and why it is required.

@chait-slim
Copy link
Author

Hi @chait-slim! Thanks for addressing the feedback.

A couple things:

First: I think we'd benefit from a call to talk about this new vulnerability data and how it should work with Grype - I am trying to give sort of high level feedback in GitHub comments and I think some context is being lost. Can you make an appointment with me at https://calendar.app.google/vtAP61H34Cu4QQWq7 ? Please include anyone who can answer questions about the semantics of the vulnerability data. Thanks!

Second: the PRs are failing the DCO check. See https://github.com/anchore/grype/blob/main/CONTRIBUTING.md#sign-off-your-work for some info on how to fix this and why it is required.

Thanks @willmurphyscode!
Ive booked some time to discuss this and the other comment as well

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