Skip to content
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

Unable to run nvd check with an API KEY #181

Closed
2 tasks done
rdelhaise-wiiisdom opened this issue Sep 10, 2024 · 2 comments
Closed
2 tasks done

Unable to run nvd check with an API KEY #181

rdelhaise-wiiisdom opened this issue Sep 10, 2024 · 2 comments

Comments

@rdelhaise-wiiisdom
Copy link

rdelhaise-wiiisdom commented Sep 10, 2024

Description

Hello,

I update nvd-clojure to the 4.0.0 version. After that, I created and imported it in a "nvd-clojure.edn" file.

The error raised by the program is the same as if I don't have an API Key:

[2024-09-10 11:36:49.399] ERROR Engine - Error updating the NVD Data; the NVD returned a 403 or 404 error

Please ensure your API Key is valid; see https://github.com/jeremylong/Open-Vulnerability-Project/tree/main/vulnz#api-key-is-used-and-a-403-or-404-error-occurs

If you NVD API Key is valid try increasing the NVD API Delay.

If this is ocurring in a CI environment
org.owasp.dependencycheck.data.update.exception.UpdateException: Error updating the NVD Data; the NVD returned a 403 or 404 error

Please ensure your API Key is valid; see https://github.com/jeremylong/Open-Vulnerability-Project/tree/main/vulnz#api-key-is-used-and-a-403-or-404-error-occurs

If you NVD API Key is valid try increasing the NVD API Delay.

If this is ocurring in a CI environment
        at org.owasp.dependencycheck.data.update.NvdApiDataSource.processApi(NvdApiDataSource.java:387)
        at org.owasp.dependencycheck.data.update.NvdApiDataSource.update(NvdApiDataSource.java:116)
        at org.owasp.dependencycheck.Engine.doUpdates(Engine.java:906)
        at org.owasp.dependencycheck.Engine.initializeAndUpdateDatabase(Engine.java:711)
        at org.owasp.dependencycheck.Engine.analyzeDependencies(Engine.java:637)
        at nvd.task.check$scan_and_analyze$fn__801.invoke(check.clj:52)
        at nvd.task.check$scan_and_analyze.invokeStatic(check.clj:51)
        at nvd.task.check$scan_and_analyze.invoke(check.clj:46)
        at nvd.task.check$impl.invokeStatic(check.clj:89)
        at nvd.task.check$impl.invoke(check.clj:81)
        at nvd.task.check$_main.invokeStatic(check.clj:148)
        at nvd.task.check$_main.doInvoke(check.clj:100)
        at clojure.lang.RestFn.invoke(RestFn.java:421)
        at nvd$_main.invokeStatic(nvd.clj:18)
        at nvd$_main.invoke(nvd.clj:13)
        at clojure.lang.Var.invoke(Var.java:380)
        at user$eval140.invokeStatic(form-init15379732318571741005.clj:1)
        at user$eval140.invoke(form-init15379732318571741005.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:7194)
        at clojure.lang.Compiler.eval(Compiler.java:7184)
        at clojure.lang.Compiler.load(Compiler.java:7653)
        at clojure.lang.Compiler.loadFile(Compiler.java:7591)
        at clojure.main$load_script.invokeStatic(main.clj:475)
        at clojure.main$init_opt.invokeStatic(main.clj:477)
        at clojure.main$init_opt.invoke(main.clj:477)
        at clojure.main$initialize.invokeStatic(main.clj:508)
        at clojure.main$null_opt.invokeStatic(main.clj:542)
        at clojure.main$null_opt.invoke(main.clj:539)
        at clojure.main$main.invokeStatic(main.clj:664)
        at clojure.main$main.doInvoke(main.clj:616)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.lang.Var.applyTo(Var.java:705)
        at clojure.main.main(main.java:40)
[2024-09-10 11:36:49.516] INFO KnownExploitedDataSource - Updating CISA Known Exploited Vulnerability list: https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json
[2024-09-10 11:36:49.783] INFO CveDB - Begin database defrag
[2024-09-10 11:36:50.063] INFO CveDB - End database defrag (282 ms)
[2024-09-10 11:36:50.067] WARN Engine - Unable to update 1 or more Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities.
[2024-09-10 11:36:50.067] ERROR Engine - Unable to continue dependency-check analysis.
Encountered errors while analyzing: One or more exceptions occurred during analysis:
        UpdateException: Error updating the NVD Data; the NVD returned a 403 or 404 error

Please ensure your API Key is valid; see https://github.com/jeremylong/Open-Vulnerability-Project/tree/main/vulnz#api-key-is-used-and-a-403-or-404-error-occurs

If you NVD API Key is valid try increasing the NVD API Delay.

If this is ocurring in a CI environment
        NoDataException: No documents exist
#error {
 :cause Error updating the NVD Data; the NVD returned a 403 or 404 error

Please ensure your API Key is valid; see https://github.com/jeremylong/Open-Vulnerability-Project/tree/main/vulnz#api-key-is-used-and-a-403-or-404-error-occurs

If you NVD API Key is valid try increasing the NVD API Delay.

If this is ocurring in a CI environment
 :via
 [{:type org.owasp.dependencycheck.data.update.exception.UpdateException
   :message Error updating the NVD Data; the NVD returned a 403 or 404 error

Please ensure your API Key is valid; see https://github.com/jeremylong/Open-Vulnerability-Project/tree/main/vulnz#api-key-is-used-and-a-403-or-404-error-occurs

If you NVD API Key is valid try increasing the NVD API Delay.

If this is ocurring in a CI environment
   :at [org.owasp.dependencycheck.data.update.NvdApiDataSource processApi NvdApiDataSource.java 387]}]
 :trace
 [[org.owasp.dependencycheck.data.update.NvdApiDataSource processApi NvdApiDataSource.java 387]
  [org.owasp.dependencycheck.data.update.NvdApiDataSource update NvdApiDataSource.java 116]
  [org.owasp.dependencycheck.Engine doUpdates Engine.java 906]
  [org.owasp.dependencycheck.Engine initializeAndUpdateDatabase Engine.java 711]
  [org.owasp.dependencycheck.Engine analyzeDependencies Engine.java 637]
  [nvd.task.check$scan_and_analyze$fn__801 invoke check.clj 52]
  [nvd.task.check$scan_and_analyze invokeStatic check.clj 51]
  [nvd.task.check$scan_and_analyze invoke check.clj 46]
  [nvd.task.check$impl invokeStatic check.clj 89]
  [nvd.task.check$impl invoke check.clj 81]
  [nvd.task.check$_main invokeStatic check.clj 148]
  [nvd.task.check$_main doInvoke check.clj 100]
  [clojure.lang.RestFn invoke RestFn.java 421]
  [nvd$_main invokeStatic nvd.clj 18]
  [nvd$_main invoke nvd.clj 13]
  [clojure.lang.Var invoke Var.java 380]
  [user$eval140 invokeStatic form-init15379732318571741005.clj 1]
  [user$eval140 invoke form-init15379732318571741005.clj 1]
  [clojure.lang.Compiler eval Compiler.java 7194]
  [clojure.lang.Compiler eval Compiler.java 7184]
  [clojure.lang.Compiler load Compiler.java 7653]
  [clojure.lang.Compiler loadFile Compiler.java 7591]
  [clojure.main$load_script invokeStatic main.clj 475]
  [clojure.main$init_opt invokeStatic main.clj 477]
  [clojure.main$init_opt invoke main.clj 477]
  [clojure.main$initialize invokeStatic main.clj 508]
  [clojure.main$null_opt invokeStatic main.clj 542]
  [clojure.main$null_opt invoke main.clj 539]
  [clojure.main$main invokeStatic main.clj 664]
  [clojure.main$main doInvoke main.clj 616]
  [clojure.lang.RestFn applyTo RestFn.java 137]
  [clojure.lang.Var applyTo Var.java 705]
  [clojure.main main main.java 40]]}
#error {
 :cause No documents exist
 :via
 [{:type org.owasp.dependencycheck.exception.NoDataException
   :message No documents exist
   :at [org.owasp.dependencycheck.Engine ensureDataExists Engine.java 1163]}]
 :trace
 [[org.owasp.dependencycheck.Engine ensureDataExists Engine.java 1163]
  [org.owasp.dependencycheck.Engine analyzeDependencies Engine.java 641]
  [nvd.task.check$scan_and_analyze$fn__801 invoke check.clj 52]
  [nvd.task.check$scan_and_analyze invokeStatic check.clj 51]
  [nvd.task.check$scan_and_analyze invoke check.clj 46]
  [nvd.task.check$impl invokeStatic check.clj 89]
  [nvd.task.check$impl invoke check.clj 81]
  [nvd.task.check$_main invokeStatic check.clj 148]
  [nvd.task.check$_main doInvoke check.clj 100]
  [clojure.lang.RestFn invoke RestFn.java 421]
  [nvd$_main invokeStatic nvd.clj 18]
  [nvd$_main invoke nvd.clj 13]
  [clojure.lang.Var invoke Var.java 380]
  [user$eval140 invokeStatic form-init15379732318571741005.clj 1]
  [user$eval140 invoke form-init15379732318571741005.clj 1]
  [clojure.lang.Compiler eval Compiler.java 7194]
  [clojure.lang.Compiler eval Compiler.java 7184]
  [clojure.lang.Compiler load Compiler.java 7653]
  [clojure.lang.Compiler loadFile Compiler.java 7591]
  [clojure.main$load_script invokeStatic main.clj 475]
  [clojure.main$init_opt invokeStatic main.clj 477]
  [clojure.main$init_opt invoke main.clj 477]
  [clojure.main$initialize invokeStatic main.clj 508]
  [clojure.main$null_opt invokeStatic main.clj 542]
  [clojure.main$null_opt invoke main.clj 539]
  [clojure.main$main invokeStatic main.clj 664]
  [clojure.main$main doInvoke main.clj 616]
  [clojure.lang.RestFn applyTo RestFn.java 137]
  [clojure.lang.Var applyTo Var.java 705]
  [clojure.main main main.java 40]]}
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.control.event.ElementEventQueue 
INFO: Element event queue destroyed: org.apache.commons.jcs3.engine.control.event.ElementEventQueue@717a8a76
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.control.CompositeCache 
INFO: In DISPOSE, [NODEAUDIT] fromRemote [false]
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.control.CompositeCache 
INFO: In DISPOSE, [NODEAUDIT] auxiliary [NODEAUDIT]
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.control.CompositeCache 
INFO: In DISPOSE, [NODEAUDIT] put 0 into auxiliary [NODEAUDIT]
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.AbstractDiskCache 
INFO: In dispose, destroying event queue.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.PooledCacheEventQueue 
INFO: Cache event queue destroyed: CacheEventQueue [listenerId=-615880354, cacheName=NODEAUDIT]
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [NODEAUDIT] : Saving keys to: NODEAUDIT, key count: 0
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [NODEAUDIT] : Finished saving keys.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [NODEAUDIT] : Shutdown complete.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.control.CompositeCache 
INFO: In DISPOSE, [NODEAUDIT] disposing of memory cache.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.memory.AbstractMemoryCache 
INFO: Memory Cache dispose called.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.control.CompositeCache 
INFO: In DISPOSE, [CENTRAL] fromRemote [false]
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.control.CompositeCache 
INFO: In DISPOSE, [CENTRAL] auxiliary [CENTRAL]
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.control.CompositeCache 
INFO: In DISPOSE, [CENTRAL] put 0 into auxiliary [CENTRAL]
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.AbstractDiskCache 
INFO: In dispose, destroying event queue.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.PooledCacheEventQueue 
INFO: Cache event queue destroyed: CacheEventQueue [listenerId=-615880354, cacheName=CENTRAL]
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [CENTRAL] : Saving keys to: CENTRAL, key count: 0
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [CENTRAL] : Finished saving keys.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [CENTRAL] : Shutdown complete.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.control.CompositeCache 
INFO: In DISPOSE, [CENTRAL] disposing of memory cache.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.memory.AbstractMemoryCache 
INFO: Memory Cache dispose called.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.control.CompositeCache 
INFO: In DISPOSE, [POM] fromRemote [false]
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.control.CompositeCache 
INFO: In DISPOSE, [POM] auxiliary [POM]
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.control.CompositeCache 
INFO: In DISPOSE, [POM] put 0 into auxiliary [POM]
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.AbstractDiskCache 
INFO: In dispose, destroying event queue.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.PooledCacheEventQueue 
INFO: Cache event queue destroyed: CacheEventQueue [listenerId=-615880354, cacheName=POM]
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [POM] : Saving keys to: POM, key count: 0
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [POM] : Finished saving keys.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [POM] : Shutdown complete.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.control.CompositeCache 
INFO: In DISPOSE, [POM] disposing of memory cache.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.engine.memory.AbstractMemoryCache 
INFO: Memory Cache dispose called.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.AbstractDiskCache 
INFO: In dispose, destroying event queue.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
SEVERE: Region [NODEAUDIT] : Not alive and dispose was called, filename: NODEAUDIT
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.AbstractDiskCache 
INFO: In dispose, destroying event queue.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
SEVERE: Region [CENTRAL] : Not alive and dispose was called, filename: CENTRAL
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.AbstractDiskCache 
INFO: In dispose, destroying event queue.
Sep 10, 2024 11:36:50 AM org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
SEVERE: Region [POM] : Not alive and dispose was called, filename: POM
{:clojure.main/message
 "Execution error (ExceptionInfo) at nvd.task.check/scan-and-analyze$fn (check.clj:57).\norg.owasp.dependencycheck.exception.ExceptionCollection\n",
 :clojure.main/triage
 {:clojure.error/class clojure.lang.ExceptionInfo,
  :clojure.error/line 57,
  :clojure.error/cause
  "org.owasp.dependencycheck.exception.ExceptionCollection",
  :clojure.error/symbol nvd.task.check/scan-and-analyze$fn,
  :clojure.error/source "check.clj",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type clojure.lang.Compiler$CompilerException,
    :message
    "Syntax error macroexpanding at (/private/var/folders/f8/xp5x29ts66j6d2zwth9tnkhh0000gn/T/form-init15379732318571741005.clj:1:126).",
    :data
    {:clojure.error/phase :execution,
     :clojure.error/line 1,
     :clojure.error/column 126,
     :clojure.error/source
     "/private/var/folders/f8/xp5x29ts66j6d2zwth9tnkhh0000gn/T/form-init15379732318571741005.clj"},
    :at [clojure.lang.Compiler load "Compiler.java" 7665]}
   {:type clojure.lang.ExceptionInfo,
    :message "org.owasp.dependencycheck.exception.ExceptionCollection",
    :data {:exceptions [#error {
 :cause "Error updating the NVD Data; the NVD returned a 403 or 404 error\n\nPlease ensure your API Key is valid; see https://github.com/jeremylong/Open-Vulnerability-Project/tree/main/vulnz#api-key-is-used-and-a-403-or-404-error-occurs\n\nIf you NVD API Key is valid try increasing the NVD API Delay.\n\nIf this is ocurring in a CI environment"
 :via
 [{:type org.owasp.dependencycheck.data.update.exception.UpdateException
   :message "Error updating the NVD Data; the NVD returned a 403 or 404 error\n\nPlease ensure your API Key is valid; see https://github.com/jeremylong/Open-Vulnerability-Project/tree/main/vulnz#api-key-is-used-and-a-403-or-404-error-occurs\n\nIf you NVD API Key is valid try increasing the NVD API Delay.\n\nIf this is ocurring in a CI environment"
   :at [org.owasp.dependencycheck.data.update.NvdApiDataSource processApi "NvdApiDataSource.java" 387]}]
 :trace
 [[org.owasp.dependencycheck.data.update.NvdApiDataSource processApi "NvdApiDataSource.java" 387]
  [org.owasp.dependencycheck.data.update.NvdApiDataSource update "NvdApiDataSource.java" 116]
  [org.owasp.dependencycheck.Engine doUpdates "Engine.java" 906]
  [org.owasp.dependencycheck.Engine initializeAndUpdateDatabase "Engine.java" 711]
  [org.owasp.dependencycheck.Engine analyzeDependencies "Engine.java" 637]
  [nvd.task.check$scan_and_analyze$fn__801 invoke "check.clj" 52]
  [nvd.task.check$scan_and_analyze invokeStatic "check.clj" 51]
  [nvd.task.check$scan_and_analyze invoke "check.clj" 46]
  [nvd.task.check$impl invokeStatic "check.clj" 89]
  [nvd.task.check$impl invoke "check.clj" 81]
  [nvd.task.check$_main invokeStatic "check.clj" 148]
  [nvd.task.check$_main doInvoke "check.clj" 100]
  [clojure.lang.RestFn invoke "RestFn.java" 421]
  [nvd$_main invokeStatic "nvd.clj" 18]
  [nvd$_main invoke "nvd.clj" 13]
  [clojure.lang.Var invoke "Var.java" 380]
  [user$eval140 invokeStatic "form-init15379732318571741005.clj" 1]
  [user$eval140 invoke "form-init15379732318571741005.clj" 1]
  [clojure.lang.Compiler eval "Compiler.java" 7194]
  [clojure.lang.Compiler eval "Compiler.java" 7184]
  [clojure.lang.Compiler load "Compiler.java" 7653]
  [clojure.lang.Compiler loadFile "Compiler.java" 7591]
  [clojure.main$load_script invokeStatic "main.clj" 475]
  [clojure.main$init_opt invokeStatic "main.clj" 477]
  [clojure.main$init_opt invoke "main.clj" 477]
  [clojure.main$initialize invokeStatic "main.clj" 508]
  [clojure.main$null_opt invokeStatic "main.clj" 542]
  [clojure.main$null_opt invoke "main.clj" 539]
  [clojure.main$main invokeStatic "main.clj" 664]
  [clojure.main$main doInvoke "main.clj" 616]
  [clojure.lang.RestFn applyTo "RestFn.java" 137]
  [clojure.lang.Var applyTo "Var.java" 705]
  [clojure.main main "main.java" 40]]} #error {
 :cause "No documents exist"
 :via
 [{:type org.owasp.dependencycheck.exception.NoDataException
   :message "No documents exist"
   :at [org.owasp.dependencycheck.Engine ensureDataExists "Engine.java" 1163]}]
 :trace
 [[org.owasp.dependencycheck.Engine ensureDataExists "Engine.java" 1163]
  [org.owasp.dependencycheck.Engine analyzeDependencies "Engine.java" 641]
  [nvd.task.check$scan_and_analyze$fn__801 invoke "check.clj" 52]
  [nvd.task.check$scan_and_analyze invokeStatic "check.clj" 51]
  [nvd.task.check$scan_and_analyze invoke "check.clj" 46]
  [nvd.task.check$impl invokeStatic "check.clj" 89]
  [nvd.task.check$impl invoke "check.clj" 81]
  [nvd.task.check$_main invokeStatic "check.clj" 148]
  [nvd.task.check$_main doInvoke "check.clj" 100]
  [clojure.lang.RestFn invoke "RestFn.java" 421]
  [nvd$_main invokeStatic "nvd.clj" 18]
  [nvd$_main invoke "nvd.clj" 13]
  [clojure.lang.Var invoke "Var.java" 380]
  [user$eval140 invokeStatic "form-init15379732318571741005.clj" 1]
  [user$eval140 invoke "form-init15379732318571741005.clj" 1]
  [clojure.lang.Compiler eval "Compiler.java" 7194]
  [clojure.lang.Compiler eval "Compiler.java" 7184]
  [clojure.lang.Compiler load "Compiler.java" 7653]
  [clojure.lang.Compiler loadFile "Compiler.java" 7591]
  [clojure.main$load_script invokeStatic "main.clj" 475]
  [clojure.main$init_opt invokeStatic "main.clj" 477]
  [clojure.main$init_opt invoke "main.clj" 477]
  [clojure.main$initialize invokeStatic "main.clj" 508]
  [clojure.main$null_opt invokeStatic "main.clj" 542]
  [clojure.main$null_opt invoke "main.clj" 539]
  [clojure.main$main invokeStatic "main.clj" 664]
  [clojure.main$main doInvoke "main.clj" 616]
  [clojure.lang.RestFn applyTo "RestFn.java" 137]
  [clojure.lang.Var applyTo "Var.java" 705]
  [clojure.main main "main.java" 40]]}]},
    :at
    [nvd.task.check$scan_and_analyze$fn__801 invoke "check.clj" 57]}],
  :trace
  [[nvd.task.check$scan_and_analyze$fn__801 invoke "check.clj" 57]
   [nvd.task.check$scan_and_analyze invokeStatic "check.clj" 51]
   [nvd.task.check$scan_and_analyze invoke "check.clj" 46]
   [nvd.task.check$impl invokeStatic "check.clj" 89]
   [nvd.task.check$impl invoke "check.clj" 81]
   [nvd.task.check$_main invokeStatic "check.clj" 148]
   [nvd.task.check$_main doInvoke "check.clj" 100]
   [clojure.lang.RestFn invoke "RestFn.java" 421]
   [nvd$_main invokeStatic "nvd.clj" 18]
   [nvd$_main invoke "nvd.clj" 13]
   [clojure.lang.Var invoke "Var.java" 380]
   [user$eval140 invokeStatic "form-init15379732318571741005.clj" 1]
   [user$eval140 invoke "form-init15379732318571741005.clj" 1]
   [clojure.lang.Compiler eval "Compiler.java" 7194]
   [clojure.lang.Compiler eval "Compiler.java" 7184]
   [clojure.lang.Compiler load "Compiler.java" 7653]
   [clojure.lang.Compiler loadFile "Compiler.java" 7591]
   [clojure.main$load_script invokeStatic "main.clj" 475]
   [clojure.main$init_opt invokeStatic "main.clj" 477]
   [clojure.main$init_opt invoke "main.clj" 477]
   [clojure.main$initialize invokeStatic "main.clj" 508]
   [clojure.main$null_opt invokeStatic "main.clj" 542]
   [clojure.main$null_opt invoke "main.clj" 539]
   [clojure.main$main invokeStatic "main.clj" 664]
   [clojure.main$main doInvoke "main.clj" 616]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.main main "main.java" 40]],
  :cause "org.owasp.dependencycheck.exception.ExceptionCollection",
  :data {:exceptions [#error {
 :cause "Error updating the NVD Data; the NVD returned a 403 or 404 error\n\nPlease ensure your API Key is valid; see https://github.com/jeremylong/Open-Vulnerability-Project/tree/main/vulnz#api-key-is-used-and-a-403-or-404-error-occurs\n\nIf you NVD API Key is valid try increasing the NVD API Delay.\n\nIf this is ocurring in a CI environment"
 :via
 [{:type org.owasp.dependencycheck.data.update.exception.UpdateException
   :message "Error updating the NVD Data; the NVD returned a 403 or 404 error\n\nPlease ensure your API Key is valid; see https://github.com/jeremylong/Open-Vulnerability-Project/tree/main/vulnz#api-key-is-used-and-a-403-or-404-error-occurs\n\nIf you NVD API Key is valid try increasing the NVD API Delay.\n\nIf this is ocurring in a CI environment"
   :at [org.owasp.dependencycheck.data.update.NvdApiDataSource processApi "NvdApiDataSource.java" 387]}]
 :trace
 [[org.owasp.dependencycheck.data.update.NvdApiDataSource processApi "NvdApiDataSource.java" 387]
  [org.owasp.dependencycheck.data.update.NvdApiDataSource update "NvdApiDataSource.java" 116]
  [org.owasp.dependencycheck.Engine doUpdates "Engine.java" 906]
  [org.owasp.dependencycheck.Engine initializeAndUpdateDatabase "Engine.java" 711]
  [org.owasp.dependencycheck.Engine analyzeDependencies "Engine.java" 637]
  [nvd.task.check$scan_and_analyze$fn__801 invoke "check.clj" 52]
  [nvd.task.check$scan_and_analyze invokeStatic "check.clj" 51]
  [nvd.task.check$scan_and_analyze invoke "check.clj" 46]
  [nvd.task.check$impl invokeStatic "check.clj" 89]
  [nvd.task.check$impl invoke "check.clj" 81]
  [nvd.task.check$_main invokeStatic "check.clj" 148]
  [nvd.task.check$_main doInvoke "check.clj" 100]
  [clojure.lang.RestFn invoke "RestFn.java" 421]
  [nvd$_main invokeStatic "nvd.clj" 18]
  [nvd$_main invoke "nvd.clj" 13]
  [clojure.lang.Var invoke "Var.java" 380]
  [user$eval140 invokeStatic "form-init15379732318571741005.clj" 1]
  [user$eval140 invoke "form-init15379732318571741005.clj" 1]
  [clojure.lang.Compiler eval "Compiler.java" 7194]
  [clojure.lang.Compiler eval "Compiler.java" 7184]
  [clojure.lang.Compiler load "Compiler.java" 7653]
  [clojure.lang.Compiler loadFile "Compiler.java" 7591]
  [clojure.main$load_script invokeStatic "main.clj" 475]
  [clojure.main$init_opt invokeStatic "main.clj" 477]
  [clojure.main$init_opt invoke "main.clj" 477]
  [clojure.main$initialize invokeStatic "main.clj" 508]
  [clojure.main$null_opt invokeStatic "main.clj" 542]
  [clojure.main$null_opt invoke "main.clj" 539]
  [clojure.main$main invokeStatic "main.clj" 664]
  [clojure.main$main doInvoke "main.clj" 616]
  [clojure.lang.RestFn applyTo "RestFn.java" 137]
  [clojure.lang.Var applyTo "Var.java" 705]
  [clojure.main main "main.java" 40]]} #error {
 :cause "No documents exist"
 :via
 [{:type org.owasp.dependencycheck.exception.NoDataException
   :message "No documents exist"
   :at [org.owasp.dependencycheck.Engine ensureDataExists "Engine.java" 1163]}]
 :trace
 [[org.owasp.dependencycheck.Engine ensureDataExists "Engine.java" 1163]
  [org.owasp.dependencycheck.Engine analyzeDependencies "Engine.java" 641]
  [nvd.task.check$scan_and_analyze$fn__801 invoke "check.clj" 52]
  [nvd.task.check$scan_and_analyze invokeStatic "check.clj" 51]
  [nvd.task.check$scan_and_analyze invoke "check.clj" 46]
  [nvd.task.check$impl invokeStatic "check.clj" 89]
  [nvd.task.check$impl invoke "check.clj" 81]
  [nvd.task.check$_main invokeStatic "check.clj" 148]
  [nvd.task.check$_main doInvoke "check.clj" 100]
  [clojure.lang.RestFn invoke "RestFn.java" 421]
  [nvd$_main invokeStatic "nvd.clj" 18]
  [nvd$_main invoke "nvd.clj" 13]
  [clojure.lang.Var invoke "Var.java" 380]
  [user$eval140 invokeStatic "form-init15379732318571741005.clj" 1]
  [user$eval140 invoke "form-init15379732318571741005.clj" 1]
  [clojure.lang.Compiler eval "Compiler.java" 7194]
  [clojure.lang.Compiler eval "Compiler.java" 7184]
  [clojure.lang.Compiler load "Compiler.java" 7653]
  [clojure.lang.Compiler loadFile "Compiler.java" 7591]
  [clojure.main$load_script invokeStatic "main.clj" 475]
  [clojure.main$init_opt invokeStatic "main.clj" 477]
  [clojure.main$init_opt invoke "main.clj" 477]
  [clojure.main$initialize invokeStatic "main.clj" 508]
  [clojure.main$null_opt invokeStatic "main.clj" 542]
  [clojure.main$null_opt invoke "main.clj" 539]
  [clojure.main$main invokeStatic "main.clj" 664]
  [clojure.main$main doInvoke "main.clj" 616]
  [clojure.lang.RestFn applyTo "RestFn.java" 137]
  [clojure.lang.Var applyTo "Var.java" 705]
  [clojure.main main "main.java" 40]]}]},
  :phase :execution}}

Execution error (ExceptionInfo) at nvd.task.check/scan-and-analyze$fn (check.clj:57).
org.owasp.dependencycheck.exception.ExceptionCollection

I already tried to test my API key with the Curl command asking Windows 10 CVEs and it worked properly.

To be sure my config file is correctly used I entered an int instead of a string in the :key value and it caused an error !

(ns nvd
  (:require [clojure.java.shell :as shell])
  (:require [nvd.task.check :as check]))

(defn- get-classpath-by-os
  "Returns the appropriate classpath for the current operating system"
  []
  (let [os-name (System/getProperty "os.name")]
    (if (.startsWith os-name "Windows")
      (shell/sh "cmd" "/C" "lein" "with-profile" "-user,-dev" "classpath" :dir "../")
      (shell/sh "lein" "with-profile" "-user,-dev" "classpath" :dir "../"))))

(defn -main
  "Send the classpath to nvd-clojure"
  []
  (let [classpath (get-classpath-by-os)]
    (if (zero? (:exit classpath))
      (check/-main "" (:out classpath) ) 
      (throw (Exception. "Error generating classpath : " classpath)))))

Do you have any idea ?

Version

4.0.0

Java version

openjdk 11.0.23 2024-04-16
OpenJDK Runtime Environment Temurin-11.0.23+9 (build 11.0.23+9)
OpenJDK 64-Bit Server VM Temurin-11.0.23+9 (build 11.0.23+9, mixed mode)

Installation compliance

@vemv
Copy link
Collaborator

vemv commented Sep 10, 2024

You should upgrade dependencycheck as documented in this thread #178

@rdelhaise-wiiisdom
Copy link
Author

it worked great !! Thank you !

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

No branches or pull requests

2 participants