Add Ubuntu Support

This commit is contained in:
Kota Kanbe
2017-04-26 19:30:38 +09:00
committed by kota kanbe
parent c9ab956f8f
commit 037e12b0bd
3 changed files with 15 additions and 9 deletions

View File

@@ -31,7 +31,13 @@ func (o Debian) FillCveInfoFromOvalDB(r *models.ScanResult) (*models.ScanResult,
return nil, fmt.Errorf("Failed to open OVAL DB. err: %s", err)
}
d := db.NewDebian()
var d db.OvalDB
switch r.Family {
case "debian":
d = db.NewDebian()
case "ubuntu":
d = db.NewUbuntu()
}
for _, pack := range r.Packages {
definitions, err := d.GetByPackName(r.Release, pack.Name)
if err != nil {
@@ -76,6 +82,7 @@ func (o Debian) fillOvalInfo(r *models.ScanResult, definition *ovalmodels.Defini
if !found {
cves = append(cves, vuln)
util.Log.Debugf("%s is newly detected by OVAL", vuln.CveID)
}
r.ScannedCves = cves