Skip to content

Commit

Permalink
fix(ms): always sets isPkgCvesDetactable to true
Browse files Browse the repository at this point in the history
  • Loading branch information
MaineK00n committed Sep 1, 2022
1 parent 2d959b3 commit 3595a51
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions detector/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,21 +261,23 @@ func DetectPkgCves(r *models.ScanResult, ovalCnf config.GovalDictConf, gostCnf c

// isPkgCvesDetactable checks whether CVEs is detactable with gost and oval from the result
func isPkgCvesDetactable(r *models.ScanResult) bool {
if r.Release == "" {
logging.Log.Infof("r.Release is empty. Skip OVAL and gost detection")
return false
}

if r.ScannedVia == "trivy" {
logging.Log.Infof("r.ScannedVia is trivy. Skip OVAL and gost detection")
return false
}

switch r.Family {
case constant.FreeBSD, constant.ServerTypePseudo:
logging.Log.Infof("%s type. Skip OVAL and gost detection", r.Family)
return false
case constant.Windows:
return true
default:
if r.ScannedVia == "trivy" {
logging.Log.Infof("r.ScannedVia is trivy. Skip OVAL and gost detection")
return false
}

if r.Release == "" {
logging.Log.Infof("r.Release is empty. Skip OVAL and gost detection")
return false
}

if len(r.Packages)+len(r.SrcPackages) == 0 {
logging.Log.Infof("Number of packages is 0. Skip OVAL and gost detection")
return false
Expand Down

0 comments on commit 3595a51

Please sign in to comment.