future-architect / vuls

Agent-less vulnerability scanner for Linux, FreeBSD, Container, WordPress, Programming language libraries, Network devices
https://vuls.io/
GNU General Public License v3.0
10.8k stars 1.16k forks source link

vuls report fails when openSUSE Leap 15.6 host is added to config #1975

Closed gdudas closed 1 week ago

gdudas commented 2 weeks ago

What did you do? (required. The issue will be closed when not provided.)

vuls report -config=/root/config.toml -diff-minus -format-one-line-text -to-email -format-one-email

What did you expect to happen?

Report function works without an error.

What happened instead?

Report function exit with an error.

Please re-run the command using -debug and provide the output below.

[Jun 25 10:59:20] INFO [localhost] vuls-v0.26.0-build-20240624_095311_86d3681 [Jun 25 10:59:20] INFO [localhost] Validating config... [Jun 25 10:59:20] INFO [localhost] cveDict.type=sqlite3, cveDict.url=, cveDict.SQLite3Path=/usr/share/vuls-data/cve.sqlite3 [Jun 25 10:59:20] INFO [localhost] ovalDict.type=sqlite3, ovalDict.url=, ovalDict.SQLite3Path=/usr/share/vuls-data/oval.sqlite3 [Jun 25 10:59:20] INFO [localhost] gost.type=sqlite3, gost.url=, gost.SQLite3Path=/usr/share/vuls-data/gost.sqlite3 [Jun 25 10:59:20] INFO [localhost] exploit.type=sqlite3, exploit.url=, exploit.SQLite3Path=/usr/share/vuls-data/go-exploitdb.sqlite3 [Jun 25 10:59:20] INFO [localhost] metasploit.type=sqlite3, metasploit.url=, metasploit.SQLite3Path=/usr/share/vuls-data/go-msfdb.sqlite3 [Jun 25 10:59:20] INFO [localhost] kevuln.type=sqlite3, kevuln.url=, kevuln.SQLite3Path=/usr/share/vuls-data/go-kev.sqlite3 [Jun 25 10:59:20] INFO [localhost] cti.type=sqlite3, cti.url=, cti.SQLite3Path=/usr/share/vuls-data/go-cti.sqlite3 [Jun 25 10:59:20] INFO [localhost] Loaded: /root/results/2024-06-25T10-17-20+0200 [Jun 25 10:59:20] DEBUG [localhost] leap (opensuse.leap15.6): config.ServerInfo{ BaseName: "leap", ServerName: "leap", User: "vuls", Host: "leap", IgnoreIPAddresses: []string{}, JumpServer: []string{}, Port: "22", SSHConfigPath: "", KeyPath: "/root/.ssh/vuls_rsa", CpeNames: []string{}, ScanMode: []string{ "fast-root", }, ScanModules: []string{}, OwaspDCXMLPath: "", ContainersOnly: false, ContainersIncluded: []string{}, ContainersExcluded: []string{}, ContainerType: "", Containers: map[string]config.ContainerSetting{}, IgnoreCves: []string{}, IgnorePkgsRegexp: []string{}, GitHubRepos: map[string]config.GitHubConf{}, UUIDs: map[string]string{}, Memo: "", Enablerepo: []string{}, Optional: map[string]interface {}{}, Lockfiles: []string{}, FindLock: false, FindLockDirs: []string{}, Type: "", IgnoredJSONKeys: []string{}, WordPress: &config.WordPressConf{ OSUser: "", DocRoot: "", CmdPath: "", NoSudo: false, }, PortScan: &config.PortScanConf{ IsUseExternalScanner: false, ScannerBinPath: "", HasPrivileged: false, ScanTechniques: []string{}, SourcePort: "", }, Windows: &config.WindowsConf{ ServerSelection: 0, CabPath: "", }, IPv4Addrs: []string{}, IPv6Addrs: []string{}, IPSIdentifiers: map[string]string{}, LogMsgAnsiColor: "", Container: config.Container{ ContainerID: "", Name: "", Image: "", }, Distro: config.Distro{ Family: "", Release: "", }, Mode: config.ScanMode{ flag: 0x02, }, Module: config.ScanModule{ flag: 0x0f, }, } [Jun 25 10:59:20] DEBUG [localhost] Check if oval fetched: opensuse.leap 15.6 [Jun 25 10:59:20] INFO [localhost] OVAL opensuse.leap 15.6 found. defs: 0 [Jun 25 10:59:20] ERROR [localhost] Failed to detect Pkg CVE: github.com/future-architect/vuls/detector.Detect /root/go/src/github.com/future-architect/vuls/detector/detector.go:54

Steps to reproduce the behaviour

Add an openSUSE Leap 15.6 host to config, run scan and then report.

Configuration (MUST fill this out):

Hash : vuls-v0.26.0-build-20240624_095311_86d3681

[cveDict] type = "sqlite3" SQLite3Path = "/usr/share/vuls-data/cve.sqlite3"

[exploit] type = "sqlite3" SQLite3Path = "/usr/share/vuls-data/go-exploitdb.sqlite3"

[ovalDict] type = "sqlite3" SQLite3Path = "/usr/share/vuls-data/oval.sqlite3"

[gost] type = "sqlite3" SQLite3Path = "/usr/share/vuls-data/gost.sqlite3"

[metasploit] type = "sqlite3" SQLite3Path = "/usr/share/vuls-data/go-msfdb.sqlite3"

[kevuln] type = "sqlite3" SQLite3Path = "/usr/share/vuls-data/go-kev.sqlite3"

[cti] type = "sqlite3" SQLite3Path = "/usr/share/vuls-data/go-cti.sqlite3"

[default] port = "22" user = "vuls" keyPath = "/root/.ssh/vuls_rsa"

[servers.leap] host = "leap" scanMode = [ "fast-root" ] # "fast", "fast-root" or "deep"

MaineK00n commented 1 week ago

@gdudas

[Jun 25 10:59:20] INFO [localhost] OVAL opensuse.leap 15.6 found. defs: 0

It looks like /usr/share/vals-data/ival.sqlite3 does not contain OpenSuse Leap 15.6 data. To fetch the OpenSuse Leap 15.6 data, try the following command:

$ goval-dictionary fetch suse --suse-type opensuse-leap 15.6 --dbpath "/usr/share/vals-data/ival.sqlite3"