diff options
Diffstat (limited to 'internal/feed/feed.go')
-rw-r--r-- | internal/feed/feed.go | 45 |
1 files changed, 5 insertions, 40 deletions
diff --git a/internal/feed/feed.go b/internal/feed/feed.go index b9f7678..9c27fb0 100644 --- a/internal/feed/feed.go +++ b/internal/feed/feed.go @@ -11,9 +11,6 @@ const ( Medium // medium complexity/priv req High // high complexity/priv req - Complete // complete integrity impact - Partial // partial integrity impact - Critical // critical severity CvssVersion31 // CVSS version 3.1 @@ -24,38 +21,6 @@ const ( // TODO: parse cpe -// CVSS integrity/availability impact level -type ImpactLevel int - -// Unmarshal CVSS integrity/availability impact level from JSON. -func (me *ImpactLevel) UnmarshalJSON(b []byte) error { - // decode string, check for error - var s string - if err := json.Unmarshal(b, &s); err != nil { - return err - } - - // check value - switch s { - case "NONE": - *me = None - case "LOW": - *me = Low - case "PARTIAL": - *me = Partial - case "HIGH": - *me = High - case "COMPLETE": - *me = Complete - default: - // return error - return fmt.Errorf("unknown impact level: %s", s) - } - - // return success - return nil -} - // CVSS score type Score float32 @@ -381,10 +346,10 @@ type CvssV3 struct { Scope V3Scope `json:"scope"` // integrity impact - IntegrityImpact ImpactLevel `json:"integrityImpact"` + IntegrityImpact V3Impact `json:"integrityImpact"` // availability impact - AvailabilityImpact ImpactLevel `json:"availabilityImpact"` + AvailabilityImpact V3Impact `json:"availabilityImpact"` // base score BaseScore Score `json:"baseScore"` @@ -417,9 +382,9 @@ type CvssV2 struct { // authentication Authentication Authentication `json:"authentication"` - ConfidentialityImpact ImpactLevel `json:"confidentialityImpact"` - IntegrityImpact ImpactLevel `json:"integrityImpact"` - AvailabilityImpact ImpactLevel `json:"availabilityImpact"` + ConfidentialityImpact V2Impact `json:"confidentialityImpact"` + IntegrityImpact V2Impact `json:"integrityImpact"` + AvailabilityImpact V2Impact `json:"availabilityImpact"` // base score BaseScore Score `json:"baseScore"` |