From e750bd53fcc80364e57faa8e4168924d9f85f150 Mon Sep 17 00:00:00 2001 From: Kota Kanbe Date: Mon, 20 May 2019 14:30:29 +0900 Subject: [PATCH] fix(report): fix the number of fixed/total in reporting (#817) --- models/scanresults.go | 1 + models/vulninfos.go | 2 +- wordpress/wordpress.go | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/models/scanresults.go b/models/scanresults.go index baf9122d..119876be 100644 --- a/models/scanresults.go +++ b/models/scanresults.go @@ -185,6 +185,7 @@ func (r ScanResult) FilterUnfixed() ScanResult { return r } filtered := r.ScannedCves.Find(func(v VulnInfo) bool { + // Report cves detected by CPE because Vuls can't know 'fixed' or 'unfixed' if len(v.CpeURIs) != 0 { return true } diff --git a/models/vulninfos.go b/models/vulninfos.go index ec787062..2b6730db 100644 --- a/models/vulninfos.go +++ b/models/vulninfos.go @@ -115,7 +115,7 @@ func (v VulnInfos) FormatFixedStatus(packs Packages) string { continue } total++ - if vInfo.PatchStatus(packs) == "Fixed" { + if vInfo.PatchStatus(packs) == "fixed" { fixed++ } } diff --git a/wordpress/wordpress.go b/wordpress/wordpress.go index 8eba6c19..c9a90a34 100644 --- a/wordpress/wordpress.go +++ b/wordpress/wordpress.go @@ -114,8 +114,7 @@ func FillWordPress(r *models.ScanResult, token string) (int, error) { wpVinfos = append(wpVinfos, v) util.Log.Infof("[match] %s installed: %s, fixedIn: %s", pkg.Name, pkg.Version, fixstat.FixedIn) } else { - //TODO Debugf - util.Log.Infof("[miss] %s installed: %s, fixedIn: %s", pkg.Name, pkg.Version, fixstat.FixedIn) + util.Log.Debugf("[miss] %s installed: %s, fixedIn: %s", pkg.Name, pkg.Version, fixstat.FixedIn) } } }