-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetching vulnerabilities via api for ubuntu packages by purl with version does not work #2842
Comments
@hogo6002 can you help to answer this? |
If you could help this would be great. Meanwhile it tried to understand how the osv.dev service works. My plan was to run a api-server in a Docker/Podman container and test patches on it and connect it to osv.dev database in the internet. Setting up with Podman works: ` |
Hi @Andre-85, thanks for reporting this issue!
You didn't make any mistakes, and this is by design. Currently, only we can set up the API locally because it requires the ndb credentials. The issue is due to the ecosystem being falsely parsed from the PURL in OSV. We currently get the ecosystem name from PURL spec: To solve this, we will use |
That's great news! I can't wait for testing it! Thank you very much 👍 |
Converted PURL queries to package queries in `do_query()` to remove unnecessary code. Querying the Datastore directly with PURLs gives the same results as querying by package name, so we can simplify things by treating PURLs like regular package queries after extracting the `package/ecosystem/version`. This will also resolve issue #2842 by rewriting the PURL-to-ecosystem logic. For most ecosystems, we can get the name from `purl.type`, but for Linux distributions, we need to use `purl.namespace`.
Hello everyone,
I tried to fetch vulnerabilities via api with the purl (Package URL). The SBOM from which I am extracting the packages, the purl has following format: pkg:deb/ubuntu/PACKAGE_NAME@VERSION.
What I've tested:
curl -d '{"package": {"purl": "pkg:maven/org.apache.struts/[email protected]"}}' https://api.osv.dev/v1/query
curl -d '{"package": {"purl": "pkg:deb/ubuntu/ruby-sinatra?arch=src?distro=jammy"}}' https://api.osv.dev/v1/query
curl -d '{"package": {"name": "atftp"}, "version": "0.7.git20120829-3.1~0.18.04.1", ecosystem: "ubuntu"}' https://api.osv.dev/v1/query
curl -d '{"package": {"purl": "pkg:deb/ubuntu/[email protected]~0.18.04.1"}}' https://api.osv.dev/v1/query
curl -d '{"package": {"purl": "pkg:deb/debian/[email protected]+deb10u3"}}' https://api.osv.dev/v1/query
Right now I use (3.) as a workaround, but i would be nice if it could work like (1.).Thank you very much for your help in advance.Greetings,
André
The text was updated successfully, but these errors were encountered: