fix(report): detect 0 vulns for Amazon, FreeBSD, Raspbian (#765)

This commit is contained in:
Kota Kanbe
2019-01-24 11:49:33 +09:00
committed by GitHub
parent 3178c1e326
commit 9b8a323d85
2 changed files with 13 additions and 1 deletions

View File

@@ -56,7 +56,9 @@ func FillCveInfos(dbclient DBClient, rs []models.ScanResult, dir string) ([]mode
hostname, _ := os.Hostname()
for _, r := range rs {
if c.Conf.RefreshCve || needToRefreshCve(r) {
r.ScannedCves = models.VulnInfos{}
if ovalSupported(&r) {
r.ScannedCves = models.VulnInfos{}
}
cpeURIs := []string{}
if len(r.Container.ContainerID) == 0 {
cpeURIs = c.Conf.Servers[r.ServerName].CpeNames

View File

@@ -318,6 +318,16 @@ func formatChangelogs(r models.ScanResult) string {
}
return strings.Join(buf, "\n")
}
func ovalSupported(r *models.ScanResult) bool {
switch r.Family {
case
config.Amazon,
config.FreeBSD,
config.Raspbian:
return false
}
return true
}
func needToRefreshCve(r models.ScanResult) bool {
if r.Lang != config.Conf.Lang {