ext: pass through CVSSv3 impact and exploitability score
This commit is contained in:
parent
8efc3e4038
commit
4f0da12b12
@ -60,6 +60,8 @@ type nvdCVSSv2 struct {
|
||||
|
||||
type nvdBaseMetricV3 struct {
|
||||
CVSSv3 nvdCVSSv3 `json:"cvssV3"`
|
||||
ExploitabilityScore float64 `json:"exploitabilityScore"`
|
||||
ImpactScore float64 `json:"impactScore"`
|
||||
}
|
||||
|
||||
type nvdCVSSv3 struct {
|
||||
@ -125,6 +127,8 @@ func (n nvdEntry) Metadata() *NVDMetadata {
|
||||
CVSSv3: NVDmetadataCVSSv3{
|
||||
Vectors: n.Impact.BaseMetricV3.CVSSv3.String(),
|
||||
Score: n.Impact.BaseMetricV3.CVSSv3.Score,
|
||||
ExploitabilityScore: n.Impact.BaseMetricV3.ExploitabilityScore,
|
||||
ImpactScore: n.Impact.BaseMetricV3.ImpactScore,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,8 @@ type NVDmetadataCVSSv2 struct {
|
||||
type NVDmetadataCVSSv3 struct {
|
||||
Vectors string
|
||||
Score float64
|
||||
ExploitabilityScore float64
|
||||
ImpactScore float64
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
@ -71,6 +71,8 @@ func TestNVDParser(t *testing.T) {
|
||||
CVSSv3: NVDmetadataCVSSv3{
|
||||
Vectors: "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
|
||||
Score: 9.8,
|
||||
ExploitabilityScore: 3.9,
|
||||
ImpactScore: 5.9,
|
||||
},
|
||||
}
|
||||
assert.Equal(t, wantMetadata, gotMetadata)
|
||||
|
Loading…
Reference in New Issue
Block a user