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 riskInfo to container vulns #1619

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions api/v2_vulnerabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,25 @@ type VulnerabilityContainer struct {
FixAvailable int `json:"fix_available"`
FixedVersion string `json:"fixed_version"`
} `json:"fixInfo"`
RiskInfo struct {
Factors []string `json:"factors"`
FactorsBreakdown struct {
ActiveContainers int `json:"active_containers"`
CveCounts struct {
Critical int `json:"Critical"`
High int `json:"High"`
Medium int `json:"Medium"`
Other int `json:"Other"`
} `json:"cve_counts"`
ExploitSummary struct {
DisclosureInWild string `json:"disclosure_in_wild"`
ExploitPublic string `json:"exploit_public"`
ExploitVirusMalware string `json:"exploit_virus_malware"`
ExploitWormified string `json:"exploit_wormified"`
} `json:"exploit_summary"`
InternetReachability string `json:"internet_reachability"`
} `json:"factors_breakdown"`
} `json:"riskInfo"`
ImageID string `json:"imageId"`
Severity string `json:"severity"`
StartTime time.Time `json:"startTime"`
Expand Down
48 changes: 48 additions & 0 deletions api/v2_vulnerabilities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,30 @@ func mockVulnerabilitiesContainersResponse() string {
"fixed_version": ""
},
"imageId": "sha256:123472164cb78c4d04f57bd66201c775e2dab08fce394806a03a933c5daf9e48",
"riskInfo": {
"factors": [
"cve",
"reachability",
"activeExploits",
"knownExploits"
],
"factors_breakdown": {
"active_containers": 0,
"cve_counts": {
"Critical": 2,
"High": 13,
"Medium": 14,
"Other": 20
},
"exploit_summary": {
"disclosure_in_wild": "Yes",
"exploit_public": "Yes",
"exploit_virus_malware": "No",
"exploit_wormified": "No"
},
"internet_reachability": "Unknown"
}
},
"severity": "Low",
"startTime": "2022-02-10T10:05:11.418Z",
"status": "EXCEPTION",
Expand Down Expand Up @@ -342,6 +366,30 @@ func mockVulnerabilitiesContainersResponse() string {
"fixed_version": ""
},
"imageId": "sha256:123472164cb78c4d04f57bd66201c775e2dab08fce394806a03a933c5daf9e48",
"riskInfo": {
"factors": [
"cve",
"reachability",
"activeExploits",
"knownExploits"
],
"factors_breakdown": {
"active_containers": 0,
"cve_counts": {
"Critical": 2,
"High": 13,
"Medium": 14,
"Other": 20
},
"exploit_summary": {
"disclosure_in_wild": "Yes",
"exploit_public": "Yes",
"exploit_virus_malware": "No",
"exploit_wormified": "No"
},
"internet_reachability": "Unknown"
}
},
"severity": "Info",
"startTime": "2022-02-10T10:05:11.418Z",
"status": "VULNERABLE",
Expand Down
Loading