Skip to main content
In this walkthrough, we’ll demonstrate how to
  1. Upgrade a vulnerable Spring Security dependency.
  2. Configure OWASP ZAP API scan to ignore expected warnings.
  3. Adjust OWASP Dependency-Check thresholds and verify results.
Integrating these steps into your CI/CD pipeline ensures continuous security hygiene for new code and dependencies.

1. Upgrade Spring Security Dependency

Run your Trivy scan to identify current vulnerabilities:
The scan reports two HIGH issues in Spring Security. We’ll upgrade both to 5.4.4. Open pom.xml and locate your parent and properties:
Hover over the parent in your IDE to confirm Spring Security is at 5.3.5.RELEASE. Then override it by adding the following to the <properties> block:
The image shows a screenshot of a development environment, likely an IDE, displaying a POM file with a list of dependencies and their versions. The interface includes a file explorer on the left and a code editor on the right.
Rebuild your project and rerun the Trivy scan. You should now see no high-severity Spring Security vulnerabilities.

2. Configure OWASP ZAP API Scan to Ignore Specific Warnings

By default, ZAP flags all rule violations, even those expected by your API. For example:

2.1 Generate Default ZAP Configuration

Use the OpenAPI scan script to generate a baseline gen_file:
This creates a rules file where all rules are set to WARN.
The image shows a list of security warnings and vulnerabilities from an OWASP ZAP scan, displayed in a web browser.

2.2 Define Ignored Rules

Create a zap_rules file at your repo root to ignore specific rule IDs:
Use tabs between columns—not spaces—to separate ruleId, status, and description.

2.3 Update zap.sh

Modify your scan script to reference zap_rules and generate an HTML report:
Commit both zap_rules and zap.sh, then start a Jenkins build.
The image shows a Jenkins dashboard displaying a list of pipeline runs for a project named "devsecops-numeric-application," with details such as status, run number, commit message, duration, and completion time.
In the ZAP stage logs, you’ll see ignored rules:

3. Adjust Dependency-Check and Verify Results

Since we resolved Spring Security issues, lower your failBuildOnCVSS threshold in the OWASP Dependency-Check Maven plugin:
Lowering the failBuildOnCVSS threshold may allow medium-risk vulnerabilities to pass the build. Only do this after ensuring critical issues are remediated.
Push your changes and review the Dependency-Check results in Jenkins:
The image shows a Jenkins interface displaying Dependency-Check results, listing vulnerabilities in various files with their severity and weaknesses.
Finally, rerun the Trivy scan to confirm there are zero issues:

Conclusion

By upgrading Spring Security, customizing OWASP ZAP scans, and tuning Dependency-Check thresholds, you can maintain a secure codebase and reduce noise from expected warnings. Automate these steps in your CI/CD pipeline to enforce continuous security validation.

References

Watch Video