jeremylong / DependencyCheck

OWASP dependency-check is a software composition analysis utility that detects publicly disclosed vulnerabilities in application dependencies.
https://owasp.org/www-project-dependency-check/
Apache License 2.0
6.34k stars 1.27k forks source link

Nexus/Central analyzers should fail hard when they cannot download some file #1112

Open v6ak opened 6 years ago

v6ak commented 6 years ago

Excerpt from NexusAnalyzer:

            } catch (DownloadFailedException ex) {
                LOGGER.warn("Unable to download pom.xml for {} from Nexus repository; "
                        + "this could result in undetected CPE/CVEs.", dependency.getFileName());
            } finally {

In order to have stable scans, I would rather fail (i.e., throw an exception) at this point. Maybe this could be configurable, but I find this reasonable as the default behavior.

Without that, a connection issue can affect the build. That would be OK if that meant build failure (that is, ODC finds out that it misses some important information). This is not OK if it means that ODC pretends everything is OK.

EDIT: I have hit Enter prematurely…

mprins commented 6 years ago

I disagree, I think this warning is appropriate; the repository mananagers do not provide vulnerability information, just a better identification of artifacts in case you're not using Maven.

v6ak commented 6 years ago

It depends on type of failure:

When you look at the fetchFile method, DownloadFailedException is thrown in all the cases, not just in case of 404. And that's the point of the issue.

jeremylong commented 6 years ago

Thanks for the suggestion. I agree we should differentiate between the reasons for the failure and in some cases fail the execution vs. just outputting a warning.