Last update: 2017/02/06 : Check on FreeBSD 11
VulsというToolが公開されている。https://github.com/future-architect/vuls/blob/master/README.ja.md
要するに、Linux(現時点ではUbuntu, Debian, CentOS, Amazon Linux, RHEL)及びFreeBSDに対する脆弱性検出ツールである。 誤解する人もいるみたいだが、このツールは脆弱性を「検出」するだけであって、対処(pkgのUpgradeとか)はしない。 対象のServerにsshでloginして、様々な情報を持ってくることでそのシステム内の脆弱性を検出する。 したがって、rootでsshするという操作になる。(ただし、これは現在改良中らしい)
Vulsは、Goで動作する。散々わがままを言った挙句、VulsはFreeBSD上でも問題なく動作した。
cd ~monitorsudo -u monitor ssh-keygen -t ed25519cat ~/.ssh/id_ed25519.pub » ~/.ssh/authorized_keyschmod 600 ~/.ssh/authorized_keysmkdir /var/log/vulschown monitor /var/log/vulscomod 700 /var/log/vulsexport GOPATH=$HOME/go export PATH=$PATH:$GOPATH/bin
mkdir -p $GOPATH/src/github.com/kotakanbecd $GOPATH/src/github.com/kotakanbe/cd $GOPATH/src/github.com/kotakanbe/go-cve-dictionarymake installfor i in 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017; do go-cve-dictionary fetchnvd -years $i go-cve-dictionary fetchjvn -years $i # もしJVNの情報が要らないならば、ここはskipしても良い done
for i in {2002..2017}; do go-cve-dictionary fetchnvd -years $i; done で行ける-rw-r--r-- 1 monitor staff 740999168 Feb 6 12:38 cve.sqlite3 -rw-r--r-- 1 monitor staff 32768 Feb 6 12:39 cve.sqlite3-shm -rw-r--r-- 1 monitor staff 22956672 Feb 6 12:39 cve.sqlite3-wal
mkdir -p $GOPATH/src/github.com/future-architectcd $GOPATH/src/github.com/future-architectcd $GOPATH/src/github.com/future-architect/vulsmake installgo get github.com/future-architect/vulsgo-cve-dictionary server[servers] [servers.example] host = "192.0.2.1" port = "22" user = "monitor" keyPath = "/home/vuls/.ssh/id_rsa"
まだまだ考える必要がある部分はあるが、なかなか素晴らしい。