Error running depndency-check with Maven/Jenkins
See original GitHub issueHi! I am running into an issue with maven-dependency-check plugin. The issue sums up to allowing XML/XSD parsing through Maven via Jenkins. How should I set the accessExternalSchema property? Thx
Logs
...
16:49:31 [INFO] Created CPE Index (4 seconds)
16:49:31 [WARNING] Unable to parse suppression xml file 'dependency-check-suppression.xml'
16:49:31 [WARNING] org.owasp.dependencycheck.xml.suppression.SuppressionParseException: org.xml.sax.SAXException: Line=2, Column=281: schema_reference: Failed to read schema document 'dependency-suppression.1.2.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.
16:49:31 [ERROR] Exception occurred initializing CPE Analyzer.
16:49:31 [INFO] Finished CPE Analyzer (4 seconds)
16:49:31 [INFO] Finished False Positive Analyzer (0 seconds)
16:49:31 [INFO] Finished NVD CVE Analyzer (0 seconds)
16:49:31 [INFO] Finished Sonatype OSS Index Analyzer (0 seconds)
16:49:32 [WARNING] Unable to parse suppression xml file 'dependency-check-suppression.xml'
16:49:32 [WARNING] org.owasp.dependencycheck.xml.suppression.SuppressionParseException: org.xml.sax.SAXException: Line=2, Column=281: schema_reference: Failed to read schema document 'dependency-suppression.1.2.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.
16:49:32 [ERROR] Exception occurred initializing Vulnerability Suppression Analyzer.
16:49:32 [INFO] Finished Vulnerability Suppression Analyzer (0 seconds)
16:49:32 [INFO] Finished Dependency Bundling Analyzer (0 seconds)
16:49:32 [INFO] Analysis Complete (5 seconds)
...
POM.xml
The plugin version is 5.1.0. A test with previous version 3.0.2 also failed in a similar manner.
<build>
<pluginManagement>
<plugins>
...
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>${dependency.check.plugin.version}</version>
</plugin>
....
</plugins>
</pluginManagement>
</build>
....
<profile>
<id>owasp</id>
<build>
<plugins>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/owasp</outputDirectory>
<name>dependency-check-report</name>
<format>XML</format>
<accessExternalSchema>all</accessExternalSchema>
<showSummary>false</showSummary>
<skipProvidedScope>true</skipProvidedScope>
<rubygemsAnalyzerEnabled>false</rubygemsAnalyzerEnabled>
<bundleAuditAnalyzerEnabled>false</bundleAuditAnalyzerEnabled>
<assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled>
<nspAnalyzerEnabled>false</nspAnalyzerEnabled>
<suppressionFiles>dependency-check-suppression.xml</suppressionFiles>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
[JENKINS-59869] OWASP Dependency-Check Plugin v5.2.2 ...
When we run the pipeline with the script mentioned above, we get the following error. [DependencyCheck] 'java' is not recognized as an internal...
Read more >Jenkinsfile pipeline with DependenceCheck fail with RetireJS ...
[ERROR] Re-run Maven using the -X switch to enable full debug logging. Jenkins Pipeline stage('dependencyCheck') { steps { parallel( ...
Read more >dependency-check – Tasks
Runs dependency -check against a multi-project build and generates a report. dependencyCheckUpdate, Updates the local cache of the NVD data from NIST.
Read more >OWASP Dependency-Check
Dependency -Check is a Software Composition Analysis (SCA) tool suite that identifies project dependencies and checks if there are any known, ...
Read more >Jenkins Pipeline: SonarQube and the OWASP Dependency ...
Jenkins Pipeline: SonarQube and OWASP Dependency-Check. An easy setup to check for vulnerabilities in dependencies during your build ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve seen this in fully qualified schema/namespace; default for sax parsers is disallow downloading ( (==external to the suppression file) schema files,
you may be able to configure this using
-Djavax.xml.accessExternalSchema=all
on your commandlinesee also: https://docs.oracle.com/javase/tutorial/jaxp/properties/properties.html
Thanks for your help! I can confirm that your suggestion works for me.
I’m not sure where those extra schema location attributes are coming from (maybe IntelliJ IDEA code completion when I tried to format and edit the file) but they seem to be causing the issue. Removing
xmlns:xsi
,xsi:schemaLocation
and updating the schema version to 1.3 sort out the problem