- 追加された行はこの色です。
- 削除された行はこの色です。
目次~
#contents
**概要 [#g0ba3f8a]
脆弱性検知ツール「Vuls」のインストール手順。~
** [#l8692a2a]
**環境情報 [#l8692a2a]
|BGCOLOR(#CCCCCC):OS|CentOS 6.8|2.6.32-642.3.1.el6.x86_64|
|BGCOLOR(#CCCCCC):git|git-1.7.1-4.el6_7.1.x86_64||
|BGCOLOR(#CCCCCC):sqlite|sqlite-3.6.20-1.el6_7.2.x86_64||
|BGCOLOR(#CCCCCC):golang|go1.6.3||
|BGCOLOR(#CCCCCC):vuls|||
** 環境整備[#z256ff09]
GO言語等の動作環境を整備する。
-基礎パッケージの導入
yum -y install gcc sqlite
-gitの入れ替え
yum -y remove git
wget https://www.kernel.org/pub/software/scm/git/git-2.8.2.tar.gz
tar xfvz git-2.8.2.tar.gz
cd git-2.8.2
./configure --prefix=/usr/local
make prefix=/usr/local all
make prefix=/usr/local install
-gitのバージョンを確認
# /usr/local/bin/git --version
git version 2.8.2
-GO言語の導入
wget https://storage.googleapis.com/golang/go1.6.3.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.6.3.linux-amd64.tar.gz
mkdir /var/log/vuls
mkdir /usr/local/vuls
-環境変数の定義~
GO言語関連の環境変数を定義する。~
変数を恒久化するためには.bash_profileへ追記すること。~
export PATH=$PATH:/usr/local/bin:/usr/local/go/bin
export GOPATH=/usr/local/vuls
**CVEの導入 [#bd761a13]
-go-cve-dictionaryの導入
go get github.com/kotakanbe/go-cve-dictionary
-脆弱性情報の取得
2002年〜2016年までのCVEを取得する。~
cd /usr/local/vuls
for i in {2002..2016}; do ./bin/go-cve-dictionary fetchnvd -years $i; done
./bin/go-cve-dictionary fetchjvn -entire
-CVEサーバの起動
./bin/go-cve-dictionary server &
-jqの導入
必須ではないが、go-cve-dictionaryの動作確認に便利なため、jqを導入する。~
cd /usr/local/bin
wget http://stedolan.github.io/jq/download/linux64/jq
chmod 755 jq
-CVEサーバの動作確認
curl http://127.0.0.1:1323/cves/CVE-2014-0160 | /usr/bin/jq "."
以下のような出力が得られる。
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7222 0 7222 0 0 518k 0 --:--:-- --:--:-- --:--:-- 705k
{
"CveID": "CVE-2014-0160",
"Nvd": {
"Summary": "The (1) TLS and (2) DTLS implementations in OpenSSL 1.0.1 before 1.0.1g do not properly handle Heartbeat Extension packets, which allows remote attackers to obtain sensitive information from process memory via crafted packets that trigger a buffer over-read, as demonstrated by reading private keys, related to d1_both.c and t1_lib.c, aka the Heartbleed bug.",
"Score": 5,
"AccessVector": "NETWORK",
"AccessComplexity": "LOW",
"Authentication": "NONE",
"ConfidentialityImpact": "PARTIAL",
"IntegrityImpact": "NONE",
"AvailabilityImpact": "NONE",
"Cpes": null,
"References": [
{
"Source": "CONFIRM",
"Link": "http://advisories.mageia.org/MGASA-2014-0165.html"
},
**Vulsの導入 [#lf2b1585]
-vulsの導入
go get -v github.com/future-architect/vuls
https://github.com/future-architect/vuls#usage-prepare