fix(libscan): update trivy deps (#1070)

This commit is contained in:
Kota Kanbe
2020-11-05 15:38:12 +09:00
committed by GitHub
parent f78dab50cb
commit 2fc3462d35
6 changed files with 114 additions and 54 deletions

View File

@@ -10,6 +10,7 @@ import (
"time"
c "github.com/future-architect/vuls/config"
"github.com/future-architect/vuls/libmanager"
"github.com/future-architect/vuls/models"
"github.com/future-architect/vuls/report"
"github.com/future-architect/vuls/scan"
@@ -56,6 +57,14 @@ func (h VulsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}
nCVEs, err := libmanager.DetectLibsCves(&result)
if err != nil {
util.Log.Error("Failed to fill with Library dependency: %w", err)
http.Error(w, err.Error(), http.StatusServiceUnavailable)
}
util.Log.Infof("%s: %d CVEs are detected with Library",
result.FormatServerName(), nCVEs)
if err := report.FillCveInfo(h.DBclient, &result, []string{}, true); err != nil {
util.Log.Error(err)
http.Error(w, err.Error(), http.StatusServiceUnavailable)