Closed dotemacs closed 3 years ago
Also, minor points (probably unrelated to this issue):
using nvd-clojure: and dependency-check: 5.3.2
Checking dependencies for unknown ...
Also, minor points (probably unrelated to this issue):
- it should be showing the nvd version number here
using nvd-clojure: and dependency-check: 5.3.2
- for deps.edn, can we show the project name instead of unknown here
Checking dependencies for unknown ...
Good points, I'll try to tackle them in the next PR, specifically targeting those points.
While we're talking about them, getting the version number for nvd-clojure
can be derived from project.clj
. But for some other project, using Clojure CLI, you can't get the name from deps.edn
, because the name is not specified like it would be in project.clj
. So I'd have to think that one through...
tl;dr: the results of vulnerability checking of a repo via Leiningen and Clojure CLI differ, this is due to the way the classpath is created by those tools. I think that I have a solution. Read on for details.
See the output of the run on a sample repo (https://github.com/dotemacs/pdfboxing):
I've added
lein-nvd
as a plugin in my$HOME/.lein/profiles.clj
, whereas my deps.edn is:The issue here is that when I ran
clj -M:nvd
it obviously picked up the classpath from that alias, but by doing that, it included the libraries needed bynvd.task.check/-main
to run.My thinking is that the way to work out the classpath for a project/library is not to use the classpath it is running from, when using Clojure CLI, but to read
deps.edn
, in particular the values under:deps
key, and construct a classpath from that. See this example for details: https://github.com/clojure/tools.deps.alpha/blob/master/API.md#example-usagePutting this here in case somebody else stumbles upon it. I plan on tackling this soon, but sharing the notes just in case I don't get to it.