Skip to content
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

feat: add vendor status #237

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

feat: add vendor status #237

wants to merge 3 commits into from

Conversation

DmitriyLewen
Copy link
Contributor

Description

Added structure with cve statuses for different vendors.
e.g.:

  "VendorStatus": {
    "nvd": "rejected",
    "redhat": "fixed",
    "alpine": "will not fix",
  }

There are next statuses:

  • "fixed"
  • "affected"
  • "will-not-fix"
  • "deferred"
  • "rejected"

@@ -77,6 +77,7 @@ type VulnerabilityDetail struct {
Description string `json:",omitempty"`
PublishedDate *time.Time `json:",omitempty"` // Take from NVD
LastModifiedDate *time.Time `json:",omitempty"` // Take from NVD
Status bool `json:",omitempty"` // Rejected or not Rejected cve. Take from NVD
Copy link
Collaborator

@knqyf263 knqyf263 Aug 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NVD actually has more statuses like DISPUTED. We currently support "REJECTED" or not only, but I want to make it flexible for future enhancement.
https://nvd.nist.gov/general/cve-process

Suggested change
Status bool `json:",omitempty"` // Rejected or not Rejected cve. Take from NVD
Status types.Status `json:",omitempty"` // Take from NVD

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean we should define type Status string somewhere.

func (Vulnerability) Normalize(details map[types.SourceID]types.VulnerabilityDetail) types.Vulnerability {
if details[NVD].Status {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if details[NVD].Status {
if details[NVD].Status == types.StatusRejected {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants