-
Notifications
You must be signed in to change notification settings - Fork 310
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
Extend vulnerability model to support multiple sources #3823
Extend vulnerability model to support multiple sources #3823
Conversation
6242747
to
ad01500
Compare
ad01500
to
6e792b6
Compare
6e792b6
to
c8cc47d
Compare
c8cc47d
to
055aa8f
Compare
.map { | ||
Vulnerability( | ||
it.cveId.orEmpty(), | ||
listOf(VulnerabilityReference(URI(it.url), null, (it.cvss ?: SEVERITY_UNDEFINED).toString())) |
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.
I believe what we really should do here instead of
(it.cvss ?: SEVERITY_UNDEFINED).toString())
is
it.cvss?.toString() ?: UNKNOWN_SEVERITY
and introduce const UNKNOWN_SEVERITY = "Unknown"
to VulnerabilityReference
. But that can be done later when touching this code anyway for the bulk-fetch implementation.
I have added one more commit to add a custom deserializer for the |
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.
As for the deserialisation, I think it is good to be able to use our old advisor results.
Just keep in mind that this should be removed at some point in the future.
9e8c206
to
67af3a4
Compare
Removed breaking-change label. With the custom deserializer for vulnerabilities, this is no longer a breaking change. |
67af3a4
to
25fa967
Compare
When querying vulnerability information from multiple providers information about a single vulnerability can be found at different sources. To represent such a source and the information it contains, introduce a new data class. In a later commit, the Vulnerability class will be given a list of these references. Signed-off-by: Oliver Heger <[email protected]>
25fa967
to
ee6a225
Compare
According to the NexusIQ documentation [1], the scoring system used by vulnerabilities is either CVSS2 or CVSS3; the concrete one is determined by the prefix of the reference of a vulnerability. Add a function to obtain the scoring system based on this reference. This information is needed to provide additional data for vulnerabilities as supported by the extended data model of the advisor. [1] https://guides.sonatype.com/iqserver/technical-guides/sonatype-vuln-data/#how-is-a-vulnerability-score-severity-calculated Signed-off-by: Oliver Heger <[email protected]>
The Vulnerability data class now stores a list of VulnerabilityReferences containing the information from different sources. Adapt the existing advisor implementations accordingly. Note that at this stage, there is no implementation that actually returns multiple references for a single vulnerability; but this is going to change for VulnerableCode. Signed-off-by: Oliver Heger <[email protected]>
With the changes on the data structures to store vulnerabilities, older ORT results can no longer be deserialized. To fix this, add a custom deserializer, which can handle both the old and the new format of vulnerability information. Signed-off-by: Oliver Heger <[email protected]>
ee6a225
to
778a44d
Compare
This PR prepares the full integration of VulnerableCode as an advisor.
VulnerableCode supports multiple sources of vulnerability information. Each vulnerability has a list of references to the sources from which information has been drawn. To represent this, the PR extends the data model accordingly.
Note that this is only a change of the data model, but the VulnerableCode advisor implementation is not yet updated to actually populate this data model.