fix(oracle): extracting only advisory ID from OVAL.title (#1232)
This commit is contained in:
@@ -154,9 +154,12 @@ func (o RedHatBase) update(r *models.ScanResult, defPacks defPacks) (nCVEs int)
|
||||
|
||||
func (o RedHatBase) convertToDistroAdvisory(def *ovalmodels.Definition) *models.DistroAdvisory {
|
||||
advisoryID := def.Title
|
||||
if (o.family == constant.RedHat || o.family == constant.CentOS) && len(advisoryID) > 0 {
|
||||
ss := strings.Fields(def.Title)
|
||||
advisoryID = strings.TrimSuffix(ss[0], ":")
|
||||
switch o.family {
|
||||
case constant.RedHat, constant.CentOS, constant.Oracle:
|
||||
if def.Title != "" {
|
||||
ss := strings.Fields(def.Title)
|
||||
advisoryID = strings.TrimSuffix(ss[0], ":")
|
||||
}
|
||||
}
|
||||
return &models.DistroAdvisory{
|
||||
AdvisoryID: advisoryID,
|
||||
|
||||
Reference in New Issue
Block a user