feat(debian): validate running kernel version (#1382)

* feat(debian): validate running kernel version

* chore(gost/debian): only stash when there is linux package
This commit is contained in:
MaineK00n
2022-02-11 12:36:48 +09:00
committed by GitHub
parent 0cdc7a3af5
commit fe8d252c51
5 changed files with 67 additions and 33 deletions

View File

@@ -18,6 +18,7 @@ import (
"github.com/aquasecurity/fanal/analyzer"
dio "github.com/aquasecurity/go-dep-parser/pkg/io"
debver "github.com/knqyf263/go-deb-version"
"github.com/future-architect/vuls/config"
"github.com/future-architect/vuls/constant"
@@ -133,6 +134,10 @@ func (l *base) runningKernel() (release, version string, err error) {
if 6 < len(ss) {
version = ss[6]
}
if _, err := debver.NewVersion(version); err != nil {
l.log.Warnf("kernel running version is invalid. skip kernel vulnerability detection. actual kernel version: %s, err: %s", version, err)
version = ""
}
}
return
}