Aptで入るubuntu
別件でapt searchして見かけたvuls。
うまくすれば、Ubuntu Proライセンスで、バックポートを受けることができる状態で長期間使えるかもしれません。
ちょっと試してみました。
。。。先に結論。
駄目でした。
脆弱性情報ソース側の配布方法変更に追従する変更が全然入っていないので、脆弱性情報自体を持ってこれません。
持ってこれるものもあるぽいのですが、逐一切り貼り確認してまでこの方法使うメリットないですね。。
せっかくなので、調べたことはまとめておきます。
そもそも。いつからaptに入ってたの?
https://packages.ubuntu.com/search?keywords=vuls
20.04から、0.6.1が取り込まれたようです。
とりあえず手元に22.04の最初のisoがありますしたので、そいつで試してみようかと思います。
インストールしてみる
vulsのインストール
22.04は、標準サーバ+openssh-serverで準備。
そこにapt install vuls。
特に依存関係がゴロゴロ入るということもなく、配置終了。
user@ub22:~$ vuls -h
Usage: vuls <flags> <subcommand> <subcommand args>
Subcommands:
commands list all command names
flags describe all known top-level flags
help describe subcommands and their syntax
Subcommands for configtest:
configtest Test configuration
Subcommands for discover:
discover Host discovery in the CIDR
Subcommands for history:
history List history of scanning.
Subcommands for report:
report Reporting
Subcommands for scan:
scan Scan vulnerabilities
Subcommands for server:
server Server
Subcommands for tui:
tui Run Tui view to analyze vulnerabilities
Use "vuls flags" for a list of top-level flags
user@ub22:~$ vuls commands
help
flags
commands
discover
tui
scan
history
report
configtest
server
user@ub22:~$
ぱっとみ、メインで使う機能は揃っている気がします。
一方、Vulsctl相当の便利スクリプトはないので、作業は手動実施ですね。。
さて、まずは公開情報拾ってくるかーと、、gostもgoval-dictionaryも入っていないことに気が付きます。
はい。コイツラって、別パッケージで登録されているようです。。
他の必要パッケージをインストールする
vulsctl/install-host/update-all.shが呼び出しているスクリプトから、導入しないといけないコマンドを洗い出します。
POCの情報ソースであるメタスプロイット、CISA、MITRE ATT&CKを持ってくるコマンドは、aptに該当ありませんでした。
v0.6の頃は未実装だった、ということでしょうね。
aptで公開されている文をひろうと以下のとおり。
# apt install goval-dictionary gost go-cve-dictionary go-exploitdb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
redis postgresql default-mysql-server
The following NEW packages will be installed:
go-cve-dictionary go-exploitdb gost goval-dictionary
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 14.0 MB of archives.
After this operation, 44.9 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy/universe amd64 go-cve-dictionary amd64 0.3.1-4build1 [3,368 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy/universe amd64 go-exploitdb amd64 0.0~git20181130.7c961e7-2 [3,638 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy/universe amd64 gost amd64 0.1.0+git20181204.5afeda5e-1.1 [3,830 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy/universe amd64 goval-dictionary amd64 0.2.0-4build1 [3,146 kB]
Fetched 14.0 MB in 5s (2,937 kB/s)
Selecting previously unselected package go-cve-dictionary.
(Reading database ... 73198 files and directories currently installed.)
Preparing to unpack .../go-cve-dictionary_0.3.1-4build1_amd64.deb ...
Unpacking go-cve-dictionary (0.3.1-4build1) ...
Selecting previously unselected package go-exploitdb.
Preparing to unpack .../go-exploitdb_0.0~git20181130.7c961e7-2_amd64.deb ...
Unpacking go-exploitdb (0.0~git20181130.7c961e7-2) ...
Selecting previously unselected package gost.
Preparing to unpack .../gost_0.1.0+git20181204.5afeda5e-1.1_amd64.deb ...
Unpacking gost (0.1.0+git20181204.5afeda5e-1.1) ...
Selecting previously unselected package goval-dictionary.
Preparing to unpack .../goval-dictionary_0.2.0-4build1_amd64.deb ...
Unpacking goval-dictionary (0.2.0-4build1) ...
Setting up go-exploitdb (0.0~git20181130.7c961e7-2) ...
Setting up gost (0.1.0+git20181204.5afeda5e-1.1) ...
Setting up goval-dictionary (0.2.0-4build1) ...
Setting up go-cve-dictionary (0.3.1-4build1) ...
Scanning processes...
Scanning linux images...
Running kernel seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
動かしてみる > 動きませんでした
脆弱性情報のダウンロード
vulsctlのupdate-all.shを使え、、、ませんでした。
引数の仕様が違うようですね。。。
goval-dictionary(oval.sh)は駄目。
gost(gost.sh)は、OS似よりけり。debianとredhatはOKですが、ubuntuがv0.6では対応していないようです。
microsoftは対応していますが、apiキーをよこせと言われてNGです。
go-cve-dictionary(cvedb.sh)も、引数仕様が違うので駄目。
exploitdbは大丈夫。
ってことで、手打ちでやりますか。
user@ub22:~/vulsctl/install-host$ goval-dictionary fetch-redhat 5 6 7 8
INFO[05-27|04:47:00] Fetching... URL=https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL5.xml.bz2
INFO[05-27|04:47:00] Fetching... URL=https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL6.xml.bz2
INFO[05-27|04:47:00] Fetching... URL=https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL7.xml.bz2
INFO[05-27|04:47:00] Fetching... URL=https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL8.xml.bz2
INFO[05-27|04:47:01] Finished fetching OVAL definitions
EROR[05-27|04:47:01] Failed to fetch files err="Failed to fetch. err: [HTTP error. errs: [], url: https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL7.xml.bz2 HTTP error. errs: [], url: https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL8.xml.bz2 HTTP error. errs: [], url: https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL5.xml.bz2 HTTP error. errs: [], url: https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL6.xml.bz2]"
駄目ですね。。。
REHL側が情報を配布するサイトのURLを変えているみたいなのですが、aptで入れたgoval-dictionaryは古いURLを叩いてしまうようです。
まとめ
Vuls on 標準aptは、使えませんでした。