diff --git a/README.ja.md b/README.ja.md index ca1c4c44..c4e82e47 100644 --- a/README.ja.md +++ b/README.ja.md @@ -470,16 +470,38 @@ 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ファイルに出力すると詳細情報をターミナル上で参照可能 +- Root権限が必要なコマンドも発行し、より深いスキャンを行うモード +- ChangelogをパースしてCVE-IDを検知するのでFastよりも検知漏れが減る - ----- -# Performance Considerations +| 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をパースする。 @@ -487,20 +509,10 @@ Vulsをスキャン対象サーバにデプロイする。Vulsはローカルホ ただ、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`でアップデート対象のパッケージのチェンジログを取得する(パースはしない)。 ---- @@ -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 diff --git a/README.md b/README.md index b9f83e00..d1682f41 100644 --- a/README.md +++ b/README.md @@ -479,13 +479,35 @@ 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-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. +## Vuls +### Fast Scan +![Vuls-Scan-Flow](img/vuls-scan-flow-fast.png) +- Scan without Root Privilege ----- -# Performance Considerations +| 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) + +| 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. @@ -493,23 +515,10 @@ Vuls issues `apt-get changelog` for each upgradable packages and parse the chang 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. ---- @@ -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 .. @@ -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 @@ -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 ``` @@ -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 diff --git a/img/vuls-scan-flow-fast.graphml b/img/vuls-scan-flow-fast.graphml new file mode 100644 index 00000000..ded5e2f4 --- /dev/null +++ b/img/vuls-scan-flow-fast.graphml @@ -0,0 +1,415 @@ + + + + + + + + + + + + + + + + + + + + + + + Detect the OS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get installed packages +Debian/Ubuntu: dpkg-query +Amazon/RHEL/CentOS: rpm +FreeBSD: pkg + + + + + + + + + + + + + + + + Write results to JSON files + + + + + + + + + + + + + + + + Get CVE IDs by using package manager +Amazon: yum plugin security +FreeBSD: pkg audit + + + + + + + + + + + + + + + + Report + + + + + + + + + + + + + + + + + + + Vulnerability Database + + + + + + + + + + Folder 1 + + + + + + + + + + + + + + + + CVE DB (NVD / JVN) + + + + + + + + + + + + + + + + OVAL DB + + + + + + + + + + + + + + + + + + Check upgradable packages +Debian/Ubuntu: apt-get upgrade --dry-run + + + + + + + + + + + + + + + + foreach +upgradable packages + + + + + + + + + + + + + + + + Parse changelog and get CVE IDs +Debian/Ubuntu: aptitude changelog + + + + + + + + + + + + + + + + end loop + + + + + + + + + + + + + + + + + + + + + + + + + + + + Amazon +FreeBSD + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CentOS +RHEL +Ubuntu +Debian +Oracle Linux + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Raspbian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/img/vuls-scan-flow-fast.png b/img/vuls-scan-flow-fast.png new file mode 100644 index 00000000..24710d69 Binary files /dev/null and b/img/vuls-scan-flow-fast.png differ diff --git a/img/vuls-scan-flow.graphml b/img/vuls-scan-flow.graphml index 1409090b..39a67280 100644 --- a/img/vuls-scan-flow.graphml +++ b/img/vuls-scan-flow.graphml @@ -1,6 +1,6 @@ - + @@ -20,7 +20,7 @@ - Detect the OS + Detect the OS @@ -36,7 +36,7 @@ - + @@ -53,7 +53,7 @@ - Get installed packages + Get installed packages Debian/Ubuntu: dpkg-query Amazon/RHEL/CentOS: rpm FreeBSD: pkg @@ -72,7 +72,7 @@ FreeBSD: pkg - Check upgradable packages + Check upgradable packages Debian/Ubuntu: apt-get upgrade --dry-run @@ -89,7 +89,7 @@ Debian/Ubuntu: apt-get upgrade --dry-run - foreach + foreach upgradable packages @@ -106,7 +106,7 @@ upgradable packages - Parse changelog and get CVE IDs + Parse changelog and get CVE IDs Debian/Ubuntu: aptitude changelog @@ -123,7 +123,7 @@ Debian/Ubuntu: aptitude changelog - end loop + end loop @@ -139,7 +139,7 @@ Debian/Ubuntu: aptitude changelog - Select the CVE detail information + Write results to JSON files @@ -155,7 +155,7 @@ Debian/Ubuntu: aptitude changelog - Get CVE IDs by using package manager + Get CVE IDs by using package manager Amazon/RHEL: yum plugin security FreeBSD: pkg audit @@ -168,29 +168,12 @@ FreeBSD: pkg audit - - - - - - CVE DB (NVD / JVN) - - - - - - - - - - - Write results to JSON files -Reporting + Report @@ -200,14 +183,14 @@ Reporting - + - + - Get all changelogs of updatable packages at once -CentOS: yum update --changelog + Get all changelogs of updatable packages at once +yum changelog @@ -217,13 +200,13 @@ CentOS: yum update --changelog - + - + - Parse changelogs and get CVE IDs + Parse changelogs and get CVE IDs @@ -233,6 +216,87 @@ CentOS: yum update --changelog + + + + + + + Get all changelogs of updatable packages at once +Amazon / RHEL: yum changelog + + + + + + + + + + + + + + + + + + + + Vulnerability Database + + + + + + + + + + Folder 1 + + + + + + + + + + + + + + + + CVE DB (NVD / JVN) + + + + + + + + + + + + + + + + OVAL DB + + + + + + + + + + + @@ -251,8 +315,9 @@ CentOS: yum update --changelog - Debian -Ubuntu + Debian +Ubuntu +Raspbian @@ -314,7 +379,7 @@ Ubuntu - Amazon + Amazon RHEL FreeBSD @@ -328,17 +393,7 @@ FreeBSD - - - - - - - - - - - + @@ -348,7 +403,7 @@ FreeBSD - + @@ -358,29 +413,17 @@ FreeBSD - - - - - - - - - - - - - + - CentOS + CentOS - + @@ -388,7 +431,7 @@ FreeBSD - + @@ -398,11 +441,12 @@ FreeBSD - + + - - + + @@ -410,6 +454,39 @@ FreeBSD + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/img/vuls-scan-flow.png b/img/vuls-scan-flow.png index f4959b35..bd0d94c7 100644 Binary files a/img/vuls-scan-flow.png and b/img/vuls-scan-flow.png differ