Skip to content

Commit

Permalink
Update README (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
kotakanbe authored Aug 13, 2017
1 parent 47a444e commit 417df05
Show file tree
Hide file tree
Showing 6 changed files with 622 additions and 102 deletions.
59 changes: 38 additions & 21 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,37 +470,49 @@ Vulsをスキャン対象サーバにデプロイする。Vulsはローカルホ
- NVDとJVN(日本語)から脆弱性データベースを取得し、SQLite3に格納する。

## Vuls
### Fast Scan
![Vuls-Scan-Flow](img/vuls-scan-flow-fast.png)
- Root権限不要でスキャン可能なモード(Raspbian以外)
- OVALが提供されているディストリビューションは、スキャン時はパッケージのバージョンを取得するのみ。レポート時にOVAL DBとバージョン比較により脆弱性を検知する
- OVALが提供されいていないディストリビューションはスキャン時にコマンドを発行して脆弱性を検知する

| Distribution| Scan Speed | Root Privilege | OVAL |
|:------------|:-------------------|:---------------|:-----|
| CentOS | 速い |  不要 ||
| Amazon | 速い |  不要 ||
| RHEL | 速い |  不要 ||
| Oracle | 速い |  不要 ||
| FreeBSD | 速い |  不要 ||
| Ubuntu | 速い |  不要 ||
| Debian | 速い |  不要 ||
| Raspbian | 初回は遅い / 2回目以降速い |  必要 ||

### Deep Scan
![Vuls-Scan-Flow](img/vuls-scan-flow.png)
- SSHでサーバに存在する脆弱性をスキャンし、CVE IDのリストを作成する
- Dockerコンテナのスキャンする場合、VulsはまずDockerホストにSSHで接続する。その後、Dockerホスト上で `docker exec` 経由でコマンドを実効する。Dockerコンテナ内にSSHデーモンを起動する必要はない
- 検出されたCVEの詳細情報をgo-cve-dictionaryから取得する
- スキャン結果レポートを生成し、SlackやEmailなどで送信する
- スキャン結果をJSONファイルに出力すると詳細情報をターミナル上で参照可能


----
# Performance Considerations
- Root権限が必要なコマンドも発行し、より深いスキャンを行うモード
- ChangelogをパースしてCVE-IDを検知するのでFastよりも検知漏れが減る

| Distribution| Scan Speed | Root Privilege | OVAL |
|:------------|:-------------------|:---------------|:-----|
| CentOS | 遅い |  不要 ||
| Amazon | 遅い |  不要 ||
| RHEL | 遅い |  必要 ||
| Oracle | 遅い |  必要 ||
| Ubuntu | 初回は遅い / 2回目以降速い |  必要 ||
| Debian | 初回は遅い / 2回目以降速い |  必要 ||
| Raspbian | 初回は遅い / 2回目以降速い |  必要 ||
| FreeBSD | 速い |  不要 ||

- Ubuntu, Debian, Raspbian
`apt-get changelog`でアップデート対象のパッケージのチェンジログを取得し、含まれるCVE IDをパースする。
アップデート対象のパッケージが沢山ある場合、チェンジログの取得に時間がかかるので、初回のスキャンは遅い。
ただ、2回目以降はキャッシュしたchangelogを使うので速くなる。

- CentOS
アップデート対象すべてのchangelogを一度で取得しパースする。スキャンスピードは速い、サーバリソース消費量は小さい
`yum changelog`でアップデート対象のパッケージのチェンジログを取得し、含まれるCVE IDをパースする

- Amazon, RHEL and FreeBSD
高速にスキャンし、スキャン対象サーバのリソース消費量は小さい。

| Distribution| Scan Speed |
|:------------|:-------------------|
| Ubuntu | 初回は遅い / 2回目以降速い |
| Debian | 初回は遅い / 2回目以降速い |
| CentOS | 速い |
| Amazon | 速い |
| RHEL | 速い |
| FreeBSD | 速い |
| Raspbian | 初回は遅い / 2回目以降速い |
`yum changelog`でアップデート対象のパッケージのチェンジログを取得する(パースはしない)。

----

Expand Down Expand Up @@ -1739,6 +1751,11 @@ kotakanbe ([@kotakanbe](https://twitter.com/kotakanbe)) created vuls and [these
Please see [CHANGELOG](https://github.com/future-architect/vuls/blob/master/CHANGELOG.md).
----
# Stargazers over time
[![Stargazers over time](https://starcharts.herokuapp.com/future-architect/vuls.svg)](https://starcharts.herokuapp.com/future-architect/vuls)
-----
# License
Expand Down
67 changes: 39 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,37 +479,46 @@ On the aggregation server, you can refer to the scanning result of each scan tar
## [go-cve-dictionary](https://github.com/kotakanbe/go-cve-dictionary)
- Fetch vulnerability information from NVD and JVN(Japanese), then insert into SQLite3, MySQL, PostgreSQL or Redis.

## Scanning Flow
## Vuls
### Fast Scan
![Vuls-Scan-Flow](img/vuls-scan-flow-fast.png)
- Scan without Root Privilege

| Distribution| Scan Speed | Root Privilege | OVAL |
|:------------|:-------------------|:---------------|:-----|
| CentOS | Fast |  No | Yes |
| Amazon | Fast |  No | No |
| RHEL | Fast |  No | Yes |
| Oracle | Fast |  No | Yes |
| FreeBSD | Fast |  No | No |
| Ubuntu | Fast |  No | Yes |
| Debian | Fast |  No | Yes |
| Raspbian |First time: Slow / From the second time: Fast|  Yes | No |

### Deep Scan
![Vuls-Scan-Flow](img/vuls-scan-flow.png)
- Scan vulnerabilities on the servers via SSH and collect a list of the CVE ID
- To scan Docker containers, Vuls connects via SSH to the Docker host and then `docker exec` to the containers. So, no need to run sshd daemon on the containers.

----
# Performance Considerations
| Distribution| Scan Speed | Root Privilege | OVAL |
|:------------|:-------------------|:---------------|:-----|
| CentOS | Slow |  No | Yes|
| Amazon | Slow |  No | No|
| RHEL | Slow |  Yes| Yes|
| Oracle | Slow |  Yes| Yes|
| Ubuntu |First time: Slow / From the second time: Fast|  Yes| Yes|
| Debian |First time: Slow / From the second time: Fast|  Yes| Yes|
| Raspbian |First time: Slow / From the second time: Fast|  Yes| No |
| FreeBSD | Fast |  No | No|

- On Ubuntu, Debian and Raspbian
Vuls issues `apt-get changelog` for each upgradable packages and parse the changelog.
`apt-get changelog` is slow and resource usage is heavy when there are many updatable packages on target server.
Vuls stores these changelogs to KVS([boltdb](https://github.com/boltdb/bolt)).
From the second time on, the scan speed is fast by using the local cache.

- On CentOS
Vuls issues `yum update --changelog` to get changelogs of upgradable packages at once and parse the changelog.
Scan speed is fast and resource usage is light.

- On Amazon, RHEL and FreeBSD
High speed scan and resource usage is light because Vuls can get CVE IDs by using package manager(no need to parse a changelog).

| Distribution | Scan Speed |
|:-------------|:-------------------|
| Ubuntu | First time: Slow / From the second time: Fast |
| Debian | First time: Slow / From the second time: Fast |
| CentOS | Fast |
| Amazon | Fast |
| RHEL | Fast |
| Oracle Linux | Fast |
| FreeBSD | Fast |
| Raspbian | First time: Slow / From the second time: Fast |
- On CentOS
Vuls issues `yum changelog` to get changelogs of upgradable packages at once and parse the changelog.
- On RHEL, Oracle, Amazon and FreeBSD
Detect CVE IDs by using package manager.

----

Expand Down Expand Up @@ -1289,7 +1298,6 @@ $ vuls report \
-format-json \
-aws-region=ap-northeast-1 \
-aws-s3-bucket=vuls \
-aws-s3-results-dir=/bucket/path/to/results \
-aws-profile=default
```
With this sample command, it will ..
Expand Down Expand Up @@ -1553,6 +1561,8 @@ $ vuls history | peco | vuls tui -pipe
[![asciicast](https://asciinema.org/a/emi7y7docxr60bq080z10t7v8.png)](https://asciinema.org/a/emi7y7docxr60bq080z10t7v8)
----
# Usage: go-cve-dictionary on different server
Run go-cve-dictionary as server mode before scanning on 192.168.10.1
Expand All @@ -1570,6 +1580,8 @@ $ vuls report -cvedb-url=http://192.168.0.1:1323
see [go-cve-dictionary#usage-fetch-nvd-data](https://github.com/kotakanbe/go-cve-dictionary#usage-fetch-nvd-data)
----
# Usage: goval-dictionary on different server
```
Expand Down Expand Up @@ -1699,12 +1711,11 @@ kotakanbe ([@kotakanbe](https://twitter.com/kotakanbe)) created vuls and [these
Please see [CHANGELOG](https://github.com/future-architect/vuls/blob/master/CHANGELOG.md).
----
# Stargazers over time
[![Stargazers over time](https://starcharts.herokuapp.com/future-architect/vuls.svg)](https://starcharts.herokuapp.com/future-architect/vuls)
# Stargazers over time
[![Stargazers over time](https://starcharts.herokuapp.com/future-architect/vuls.svg)](https://starcharts.herokuapp.com/future-architect/vuls)
----
-----
# License
Expand Down
Loading

0 comments on commit 417df05

Please sign in to comment.