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

updater/driver: add the ability to signal "removal" in an update #1179

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions updater/driver/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@ type EnrichmentRecord struct {
// ParsedVulnerabilities is an entity-component system describing discovered
// vulnerabilities.
type ParsedVulnerabilities struct {
Updater string
// Updater is an ID for the Updater that produced this set of
// Vulnerabilities.
Updater string
// Vulnerability is the set of new and modified Vulnerabilities.
Vulnerability []Vulnerability
Package []Package
Distribution []Distribution
Repository []Repository
// The following are indexed into via Vulnerability structs.
Package []Package
Distribution []Distribution
Repository []Repository
// Removed is a list of Vulnerabilities (the "Name" member) removed in the
// current set of Vulnerabilities.
Removed []string
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to mention: I had the realization that for us the Name is generic i.e. for some VEX CVE files we generate 100s of vulnerabilities with the same name (CVE-2023-001 for samba, CVE-2023-001 for samba-libs etc). This didn't actually change much except that the UpdateVulnerabilities() method now parses existing vulnerabilities into a map[string][]string, where the key is the name (CVE-2023-001) and the value is a list of all vuln ID that share that name.

Copy link
Contributor

Choose a reason for hiding this comment

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

All that to say, I think this is still valid, it's just worth pointing out the nuanced difference

Copy link
Member Author

Choose a reason for hiding this comment

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

Right -- this isn't in use yet, but I imagine this is in the current Updater's namespace

}

// Vulnerability is all per-vulnerability information.
Expand Down
Loading