Fix testcase

This commit is contained in:
Kota Kanbe
2017-05-04 16:27:00 +09:00
committed by kota kanbe
parent c103b79ec2
commit 17a4e532c1
5 changed files with 76 additions and 135 deletions

View File

@@ -61,8 +61,7 @@ func (o Redhat) fillOvalInfo(r *models.ScanResult, definition *ovalmodels.Defini
ovalContent := *o.convertToModel(cve.CveID, definition)
vinfo, ok := r.ScannedCves.Get(cve.CveID)
if !ok {
util.Log.Infof("%s is newly detected by OVAL",
definition.Debian.CveID)
util.Log.Infof("%s is newly detected by OVAL", definition.Debian.CveID)
vinfo = models.VulnInfo{
CveID: cve.CveID,
Confidence: models.OvalMatch,
@@ -70,6 +69,11 @@ func (o Redhat) fillOvalInfo(r *models.ScanResult, definition *ovalmodels.Defini
CveContents: []models.CveContent{ovalContent},
}
} else {
if _, ok := vinfo.CveContents.Get(models.RedHat); !ok {
util.Log.Infof("%s is also detected by OVAL", definition.Debian.CveID)
} else {
util.Log.Infof("%s will be updated by OVAL", definition.Debian.CveID)
}
if vinfo.Confidence.Score < models.OvalMatch.Score {
vinfo.Confidence = models.OvalMatch
}