0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

脆弱性スキャンツールVulsインストール手順(Docker版)

Last updated at Posted at 2022-02-08

脆弱性スキャンツールVulsインストール手順(Docker版)

概要

VulsをUbuntu環境にインストールした際の手順の備忘録

環境

日付:2022/02/08時点
OS:Ubuntu 20.04LTS
Vuls:vuls-v0.19.2
66093182-20535f00-e5ca-11e9-8060-8c9247abcefa.jpg

手順

Tutorialを参考に以下を実施

インストール

  • 事前準備

    VulsコンテナからホストOSへとSSHアクセスを行うため、SSH鍵を用意し、フィンガープリント確認のために一度ログインを行う
$ ssh-keygen -q -f ~/.ssh/id_rsa -N ""
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ chmod 600 ~/.ssh/*
$ ssh `hostname -i`
$ exit
  • Gitインストール
$ sudo apt install -y git
  • Dockerをインストール
$ curl -fsSL get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
$ sudo gpasswd -a $(whoami) docker
$ sudo chgrp docker /var/run/docker.sock
$ sudo service docker restart
  • vulsio/vulsctlをクローン
$ git clone https://github.com/vulsio/vulsctl.git
$ cd vulsctl/docker
  • Config作成
$ cp ../config.toml.remotescan ./config.toml
$ vi config.toml
[servers]

[servers.remotehost]
host               = "192.168.0.1"       #検査対象ホストのIPアドレス
user               = "azureuser"         #コンテナから検査対象ホストへSSHアクセスする際のユーザ名
port               = "22"
keyPath            = "/root/.ssh/id_rsa"
scanMode           = ["fast"]            #検査モード
検査モード 概要
["fast"] root権限無しスキャン
["fast", "offline"] root権限無し、オフラインスキャン
["fast-root"] root権限有り
["fast-root", "offline"] root権限有り、オフラインスキャン
  • OVAL情報取得

    環境に応じて引数を与える
    [--redhat --amazon --debian --ubuntu --alpine --oracle --fedora]
$ ./oval.sh --ubuntu

スキャン手順

  • スキャン実行
$ ./scan.sh remotehost
  • スキャン履歴の照会
$ docker run --rm -it \
 -v $HOME/.ssh:/root/.ssh:ro \
 -v $PWD:/vuls \
 vuls/vuls \
 history
  • レポート閲覧

最新の結果を表示

./report.sh

過去分の表示

./report.sh 2022-02-08T01:30:00Z

CSVV Scoreの指定

./report.sh --cvss-over=7

reportのオプション
詳細:Report - Vuls

$ ./report.sh -h
report:
        report
                [-lang=en|ja]
                [-config=/path/to/config.toml]
                [-results-dir=/path/to/results]
                [-log-to-file]
                [-log-dir=/path/to/log]
                [-refresh-cve]
                [-cvss-over=7]
                [-confidence-over=80]
                [-diff]
                [-diff-minus]
                [-diff-plus]
                [-ignore-unscored-cves]
                [-ignore-unfixed]
                [-to-email]
                [-to-http]
                [-to-slack]
                [-to-chatwork]
                [-to-googlechat]
                [-to-telegram]
                [-to-localfile]
                [-to-s3]
                [-to-azure-blob]
                [-format-json]
                [-format-one-email]
                [-format-one-line-text]
                [-format-list]
                [-format-full-text]
                [-gzip]
                [-http-proxy=http://192.168.0.1:8080]
                [-debug]
                [-debug-sql]
                [-quiet]
                [-no-progress]
                [-pipe]
                [-http="http://vuls-report-server"]
                [-trivy-cachedb-dir=/path/to/dir]

...
  • レポート閲覧(TUI)
$ ./tui.sh

TUI操作

TAB カーソルのペイン間の移動
上下矢印キー カーソルの上下
Ctrl+j, Ctrl+k カーソルの上下
Ctrl+u, Ctrl+d ページの上下

hello-vuls-tui.png

TUIのオプション
詳細:TUI(Terminal Based Viewer - Vuls)

$ ./tui.sh -h
tui:
        tui
                [-refresh-cve]
                [-config=/path/to/config.toml]
                [-cvss-over=7]
                [-confidence-over=80]
                [-diff]
                [-diff-minus]
                [-diff-plus]
                [-ignore-unscored-cves]
                [-ignore-unfixed]
                [-results-dir=/path/to/results]
                [-log-to-file]
                [-log-dir=/path/to/log]
                [-debug]
                [-debug-sql]
                [-quiet]
                [-no-progress]
                [-pipe]
                [-trivy-cachedb-dir=/path/to/dir]
...

以上

0
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?