Skip to content

Commit 947fbbb

Browse files
authored
fix(ms): always sets isPkgCvesDetactable to true (#1492)
1 parent 06d2032 commit 947fbbb

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

detector/detector.go

+12-10
Original file line numberDiff line numberDiff line change
@@ -261,21 +261,23 @@ func DetectPkgCves(r *models.ScanResult, ovalCnf config.GovalDictConf, gostCnf c
261261

262262
// isPkgCvesDetactable checks whether CVEs is detactable with gost and oval from the result
263263
func isPkgCvesDetactable(r *models.ScanResult) bool {
264-
if r.Release == "" {
265-
logging.Log.Infof("r.Release is empty. Skip OVAL and gost detection")
266-
return false
267-
}
268-
269-
if r.ScannedVia == "trivy" {
270-
logging.Log.Infof("r.ScannedVia is trivy. Skip OVAL and gost detection")
271-
return false
272-
}
273-
274264
switch r.Family {
275265
case constant.FreeBSD, constant.ServerTypePseudo:
276266
logging.Log.Infof("%s type. Skip OVAL and gost detection", r.Family)
277267
return false
268+
case constant.Windows:
269+
return true
278270
default:
271+
if r.ScannedVia == "trivy" {
272+
logging.Log.Infof("r.ScannedVia is trivy. Skip OVAL and gost detection")
273+
return false
274+
}
275+
276+
if r.Release == "" {
277+
logging.Log.Infof("r.Release is empty. Skip OVAL and gost detection")
278+
return false
279+
}
280+
279281
if len(r.Packages)+len(r.SrcPackages) == 0 {
280282
logging.Log.Infof("Number of packages is 0. Skip OVAL and gost detection")
281283
return false

0 commit comments

Comments
 (0)