I am using this Dependency checker .sh file:
docker run --rm \
-e user=$USER \
-u $(id -u ${USER}):$(id -g ${USER}) \
--volume $(pwd):/src \
--volume "$DATA_DIRECTORY":/usr/share/dependency-check/data \
--volume $(pwd)/odc-reports:/report \
owasp/dependency-check:$DC_VERSION \
--scan /src \
--log /report/dc.log
--format "ALL" \
--project "$DC_PROJECT" \
--out /report
# Use suppression like this: (where /src == $pwd)
# --suppression "/src/security/dependency-check-suppression.xml"
________________________*Out out error is*____________ (also I don;t find log file in any path)--------- Please suggest asap-----Thanks------
latest: Pulling from owasp/dependency-check
Digest: sha256:ca73b12ee7ed5db24e007229ed8d9fd145f236b686612aa260b873487ba9c375
Status: Image is up to date for owasp/dependency-check:latest
docker.io/owasp/dependency-check:latest
[INFO] Checking for updates
[INFO] Skipping NVD check since last check was within 4 hours.
[INFO] Skipping RetireJS update since last update was within 24 hours.
[INFO] Check for updates complete (174 ms)
[INFO]
Dependency-Check is an open source tool performing a best effort analysis of 3rd party dependencies; false positives and false negatives may exist in the analysis performed by the tool. Use of the tool and the reporting provided constitutes acceptance for use in an AS IS condition, and there are NO warranties, implied or otherwise, with regard to the analysis or its use. Any use of the tool and the reporting provided is at the user鈥檚 risk. In no event shall the copyright holder or OWASP be held liable for any damages whatsoever arising out of or in connection with the use of this tool, the analysis performed, or the resulting report.
[INFO] Analysis Started
[INFO] Finished Archive Analyzer (0 seconds)
[INFO] Finished File Name Analyzer (0 seconds)
[INFO] Finished Jar Analyzer (0 seconds)
[INFO] Finished Dependency Merging Analyzer (0 seconds)
[INFO] Finished Version Filter Analyzer (0 seconds)
[INFO] Finished Hint Analyzer (0 seconds)
[INFO] Created CPE Index (2 seconds)
[INFO] Finished CPE Analyzer (2 seconds)
[INFO] Finished False Positive Analyzer (0 seconds)
[INFO] Finished NVD CVE Analyzer (0 seconds)
[INFO] Finished Sonatype OSS Index Analyzer (0 seconds)
[INFO] Finished Vulnerability Suppression Analyzer (0 seconds)
[INFO] Finished Dependency Bundling Analyzer (0 seconds)
[INFO] Analysis Complete (3 seconds)
[ERROR] Error generating the report for dependency-check scan: /var/lib/jenkins/workspace/Webapptj-CICD-Pipeline
script returned exit code 244
My guess would be that the reports directory is not writable. Does the /reports/dc.log exist? If so does it contain any additional information?
I have the same issue and there is no such report directory in /var/lib/jenkins/OWASP-Dependency-Check/ and nowhere else
Have you tried using the docker script from the README.md? https://github.com/jeremylong/DependencyCheck#docker
Also, doe $(pwd)/odc-reports exist and is $pwd writable? If not - you should adjust that line in the call to docker.
... because if using default script and the folder $(pwd)/odc-reports does not exist, the running container will create this like so (at least when using the script as is):
drwxr-xr-x 2 the_host_user root 4096 Aug 5 06:27 odc-reports
If creating the folder as the_host_user prior to running with adequate perms mitigates the issue then reports are being written. Thanks @jeremylong for the helpful hint.
It works. Also, from my side...thank you @jeremylong for your help
Most helpful comment
Have you tried using the docker script from the README.md? https://github.com/jeremylong/DependencyCheck#docker
Also, doe $(pwd)/odc-reports exist and is $pwd writable? If not - you should adjust that line in the call to docker.