-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
leverage third-party databases in order to map packages to CVEs #94
Comments
here's a prototype script that outputs metadata urls for a given vulnerability
calling that with these values could then be matched against meta.homepage and src.url to find attrpaths that are affected by a given CVE |
and here's another quick script, this time for extracting the source urls from a derivation. #!/usr/bin/env fish
function scrape_drv
if test (count $argv) = 0
return
end
scrape_drv (nix derivation show $argv | jq -r '.[keys.[]].env.src | select(type == "string")')
nix derivation show $argv | jq -r '.[keys.[]].env.urls | select(type == "string")'
end
scrape_drv $argv these are usually a bit more specific (eg. passing |
the advantage of the second approach is it fits the way vulnix currently works better, acting on store derivations instead of package attrsets. |
possibly also of use for the second case: https://git.envs.net/binarycat/nixpkgs-resolve-mirror quickly and safely translates mirror:// urls into their http equivalents. there is also the showURLs option, but executing a possibly compromised derivation seems like a bad idea. |
I think this would be a useful improvement to vulnix. |
there a few existing vulnerability databases that have an "upstream source code" field. (eg. github and arch linux both have one, also NVE has some metadata links on each CPE)
using the various metadata urls in nixpkgs (as well as src.url) it should be possible to use these to build a more accurate database of mappings.
The text was updated successfully, but these errors were encountered: