-
Notifications
You must be signed in to change notification settings - Fork 314
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
Support the CycloneDX vulnerability extension in Reporter #7751
Support the CycloneDX vulnerability extension in Reporter #7751
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7751 +/- ##
=========================================
Coverage 67.70% 67.70%
Complexity 2055 2055
=========================================
Files 358 358
Lines 16917 16917
Branches 2401 2401
=========================================
Hits 11453 11453
Misses 4467 4467
Partials 997 997
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Thanks a lot for the contribution!
plugins/reporters/cyclonedx/src/main/kotlin/CycloneDxReporter.kt
Outdated
Show resolved
Hide resolved
<vulnerability> | ||
<id>CVE-2021-1234</id> | ||
<ratings> | ||
<rating> |
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.
Any idea why no severity value (should be "MEDIUM") shows up here?
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.
Yes, it's because of the fromString(String text)
method in CycloneDX java core library, which is case-sensitive. Should I always pass the lowercase value e.g.
Severity.fromString(reference.severity?.lowercase())
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.
Let me quickly refactor some code on our side to provide better convenience functions for this use-case. I'll keep you posted.
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.
Seems like you figured out yourself already how to make use of the refactored code, great! 🚀
…rter Signed-off-by: George Andrinopoulos <[email protected]>
acfbea7
to
1af097e
Compare
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.
Looks good to me now, thanks a lot for the contribution!
source = org.cyclonedx.model.vulnerability.Vulnerability.Source() | ||
.apply { url = reference.url.toString() } | ||
severity = org.cyclonedx.model.vulnerability.Vulnerability.Rating.Severity | ||
.fromString(reference.severityRating.lowercase()) |
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.
👍
<vulnerability> | ||
<id>CVE-2021-1234</id> | ||
<ratings> | ||
<rating> |
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.
Seems like you figured out yourself already how to make use of the refactored code, great! 🚀
Merging despite the unrelated |
This PR adds support for CycloneDX vulnerabilities in Reporter.
Closes #4531