fix(report): detect 0 vulns for Amazon, FreeBSD, Raspbian (#765)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user