Open kelvinqian00 opened 10 months ago
Thanks! Yes, I noticed that the Tools setup had drifted.
I'm sorry I didn't have the time to attend that - very busy January.
setting :nvd-api {:key "87be13d2-blah-blah"}
in nvd-clojure.edn does work with Tools.
Indeed that does work, but I am using nvd-clojure in a context where having a static config file is not very practical.
Furthermore, I realize that there is a related issue: when you execute nvd-clojure without any NVD API key whatsoever, i.e. not set in the config file nor set as an env var, it should terminate after throwing the "No NVD API key supplied as config settings or env var." exception. However, instead, just like with the first example, nvd-clojure thinks there is a env var, so that exception is not thrown, and the error is only noticed at the DependencyCheck level.
Yes, I had noticed, sorry about that as well.
You might want to generate the .edn file dynamically for now.
The fix should be small anyway and can land soon.
Indeed, you might've already found the bug, but it's a one line fix. Specifically this line (since the ::not-found
does not apply when the value is nil
instead of nonexistent).
If you are willing to go through a local install process and verify it works, extending the integration test as well, PR welcome
But the hint is appreciated anyway!
I seem to be hitting this as well, but putting the into my nvd-clojure.edn doesn't help, I get the same errors. I've verified that my token is correct, following the instruction.
Hi @hlship , I've used successfully nvd-clojure with an api key in Lein and deps.edn projects alike.
May you share your config file redacted?
Actually, the code is public:
clj -T:build cve-check
builds the classpath, then invokes NVD to do the work.
This is a file that I've verified to work:
https://github.com/akvo/unep-gpml/blob/3a9782e9e7e7cc1154219f6a3f78d64deb578a63/backend/.nvd/nvd.edn
I don't consider the API keys incredibly secret btw, they are more akin to a username. Cheap to obtain with no PII associated. But one could still build them dynamically if that felt more adequate.
@hlship are you sure it's an issue with the API token ? If you verified it and it's not present in the config file it should work. It could be this problem instead: https://github.com/rm-hull/nvd-clojure/pull/179
Description
I am using the
NVD_API_TOKEN
environment variable to provide nvd-clojure with my NVD API key, and it does not work. Using the Clojure Tools method, I should have either expected the scan to proceed, or nvd-clojure to throw an "No NVD API key supplied as config settings or env var." exception. Instead, it seems that nvd-clojure recognizes that the env var was set, but that var is not passed to DependencyCheck. Thus, I get this result (note the first and last lines):followed by the NVD download failing due to the lack of an NVD API key.
Version
4.0.0
Java version
Installation compliance