fix(gost): suppress err logging when unsupported debian (#1031)

This commit is contained in:
Kota Kanbe
2020-08-05 20:05:50 +09:00
committed by GitHub
parent 3f52d318bc
commit 59daa8570a
5 changed files with 82 additions and 9 deletions

View File

@@ -21,8 +21,23 @@ type packCves struct {
cves []models.CveContent
}
func (deb Debian) Supported(major string) bool {
_, ok := map[string]string{
"8": "jessie",
"9": "stretch",
"10": "buster",
}[major]
return ok
}
// DetectUnfixed fills cve information that has in Gost
func (deb Debian) DetectUnfixed(driver db.DB, r *models.ScanResult, _ bool) (nCVEs int, err error) {
if !deb.Supported(major(r.Release)) {
// only logging
util.Log.Warnf("Debian %s is not supported yet", r.Release)
return 0, nil
}
linuxImage := "linux-image-" + r.RunningKernel.Release
// Add linux and set the version of running kernel to search OVAL.
if r.Container.ContainerID == "" {