Enhancement
Major
Detail
Major
Detail
Top-Logic uses several third-party libraries. It is far too time-consuming to check manually whether these have security vulnerabilities. Therefore, this is to be automated. The libraries found in the process must then be updated.
Implementation
There is a Maven plugin that checks for all dependencies whether there are known security vulnerabilities in the versions used. The check is done recursively. The list of known vulnerabilities is updated automatically. The plugin itself does not have to be updated every time. The Maven plugin is offered by the "Open Web Application Security Project". It is available under the Apache 2 license. Links:
- [https://en.wikipedia.org/wiki/OWASP|OWASP]
- Page]
- [https://jeremylong.github.io/DependencyCheck/dependency-check-maven/index.html|Documentation]
- Documentation]
Usage
- Add the following to tl-parent-all/pom.xml (under <project><build><plugins>):
{{#!xml <plugin> <groupId>org.owasp</groupId> <artifactId>dependency-check-maven</artifactId> <version>6.5.3</version> <configuration> <format>ALL</format> </configuration> </plugin> }}}
- Run for all modules: mvn dependency-check:check.
- Write the reports to target/dependency-check-[...].
- Update the reported libraries.
- Ensure that the check is automatically run periodically and the build fails on finds: Jenkins target CheckDependencies.
Suppression file
A suppression file is used to enter vulnerabilities that should not currently (by a certain date) be reported again. Only suppressions with an expiration date should be stored there.
This supports the following workflow: A new vulnerability is detected. The build fails with a report. A ticket for the update of this library is created and a suppression for this vulnerability with an expiration date is entered into the suppression file. The build is then green again. If the ticket is not processed by the entered expiration date, the check fails again and reminds of the still open security issue .The suppression file is maintained in Trac: DependencyCheckSuppressions
Details
When using <format>ALL</format> the following reports are generated:
- dependency-check-junit.xml
- dependency-check-report.csv
- dependency-check-report.html
- dependency-check-report.json
- dependency-check-report.sarif
- dependency-check-report.xml
The dependency-check-junit.xml file is used to cause a test to fail when a vulnerability is detected, marking the build as unstable.
The file dependency-check-report.html contains a detailed report, which can also be used to generate a suppression for the suppression file.
Test
- Run mvn dependency-check:check in all applications.
- No vulnerabilities should be reported.
- Check that:
- the Jenkins runs this check automatically on a regular basis (Target CheckDependencies).
- the corresponding build fails in case of security vulnerabilities
- we are informed about it.