How to Use the Dependency-Check Jenkins Plugin

Aug 24, 2024 | Programming

The Dependency-Check Jenkins Plugin is a handy tool for identifying project dependencies and checking for known vulnerabilities, contributing to a secure development environment. In this article, we’ll take a closer look at how to set up and use this plugin effectively.

Understanding the Components

The Dependency-Check plugin consists of three main components:

  • Global Tool Configuration: Where you define your Dependency-Check installations.
  • Builder: Executes the analysis using the installed CLI.
  • Publisher: Reads results and generates metrics.

Step-by-Step Setup

1. Global Tool Configuration

Begin by setting up the Dependency-Check installation in Jenkins:

  • Navigate to Manage Jenkins > Global Tool Configuration.
  • Here, you can install one or more Dependency-Check versions either automatically (downloading from GitHub) or manually (by providing the installation path).

Global Tool Configuration

2. Builder Configuration

Next, set up the builder to analyze your dependencies:

  • Add a build step and select the Dependency-Check option.
  • Fill in the Arguments field according to your project’s needs; these arguments will be sent directly to the CLI.

Builder Configuration

Starting with version 9.0.0, the plugin switched from using the NVD data-feed to the NVD API. To ensure fast updates, obtain an NVD API Key from here. Without it, the update speed of Dependency-Check will be considerably slower.

Keep in mind, the NVD API has rate limits. If you’re using a single API key with multiple builds, you might encounter 403 errors. In continuous integration (CI) environments, consider a caching strategy or utilize an external database updated weekly.

3. Publisher Configuration

The publisher reads the generated dependency-check-report.xml file and produces metrics and trends.

  • Configure the publisher to fail builds or issue warnings based on configurable thresholds.
  • When set up, it will generate a trending chart displaying findings grouped by severity.

Publisher Configuration
Publisher Trend

The trend chart is interactive—hovering over a build displays key severity details.

Publisher Trend Hover

You can view per-build results, with findings displayed in an interactive table that allows sorting, searching, and pagination. Expanded findings reveal additional details.

Publisher Results Expanded

Troubleshooting Tips

Here are some common issues and their solutions:

  • Slow updates: Ensure you have obtained and configured your NVD API Key properly.
  • 403 errors: Review your API usage and consider implementing a caching strategy or an external database to share the load among multiple builds.
  • Configuration issues: Double-check the paths and settings in your Global Tool Configuration to ensure everything is properly referenced.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

By following these steps, you can leverage the Dependency-Check Jenkins Plugin to enhance the security of your software development process, ensuring that your project dependencies are not introducing vulnerabilities.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox