-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance OSV Parser to Include Mitigation Information with Fixed Package Versions #11681
base: dev
Are you sure you want to change the base?
Conversation
… (fixed versions)
DryRun Security SummaryThe code changes enhance the OSV scanner parser in DefectDojo by improving vulnerability data extraction (including mitigation, CWE details, and references) and adding comprehensive unit tests to ensure reliable processing of security findings. Expand for full summarySummary: The provided code changes focus on enhancing the functionality of the OSV (Open-Source Vulnerabilities) scanner parser in the DefectDojo application security tool. The key improvements include the ability to extract mitigation information, CWE (Common Weakness Enumeration) details, and comprehensive references for the identified vulnerabilities. These changes help provide more detailed and actionable information to the DefectDojo users, which is an important aspect of effective application security. Additionally, the code changes include a comprehensive set of unit tests for the Files Changed:
Code AnalysisWe ran |
Sorry, here is the unittest test. |
Could you also fix the ruff linter @4b75726169736859 ? |
yes just after my work day |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding empty line
This pull request aligns with the current contribution guidelines by enhancing the OSV parser. The changes introduce mitigation details for vulnerabilities.
Description
This pull request enhances the
OSC Scan
parser by adding support for mitigation information, specifically the fixed versions of affected packages.Key Changes:
Extraction of Fixed Versions:
ranges
field within theaffected
section of each vulnerability.fixed
version from theevents
list when available and formatted it as:Upgrade to version: <fixed_version>
.Integration of Mitigation:
mitigation
field in findings to provide actionable guidance for resolving vulnerabilities.Enhanced Usability:
Testing Support:
Test Results
Testing was conducted using the provided sample JSON file (
test.json
). The parser correctly identifies findings and includes mitigation details in its output.Example Output:
CVE-2024-50252_linux
Medium
Upgrade to version: 6.1.119-1
Additionally, I verified that:
Although unit tests are planned to extend dojo/unittests, I was unable to complete them as I did not fully understand their functionality. However, I took screenshots of the final output to validate the results.
Documentation
The documentation has been updated to reflect this new feature:
Checklist
dev
branch.flake8
and Python 3.11 compliant.Labels
Import Scans
,enhancement
Extra Information
This pull request enhances the usability of the OSV parser, making it more actionable by including mitigation details. It also aligns with existing parsers, such as WPScan, which already support fixed versions, ensuring consistency across DefectDojo.
If you need further clarifications or adjustments, feel free to let me know!