Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README #225 #242

Merged
merged 1 commit into from
Nov 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 19 additions & 81 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ VulsはSSHパスワード認証をサポートしていない。SSH公開鍵鍵

Vulsセットアップに必要な以下のソフトウェアをインストールする。

- SQLite3
- SQLite3 or MySQL
- git
- gcc
- go v1.7.1 or later
Expand Down Expand Up @@ -606,7 +606,8 @@ scan:
[-lang=en|ja]
[-config=/path/to/config.toml]
[-results-dir=/path/to/results]
[-cve-dictionary-dbpath=/path/to/cve.sqlite3]
[-cve-dictionary-dbtype=sqlite3|mysql]
[-cve-dictionary-dbpath=/path/to/cve.sqlite3 or mysql connection string]
[-cve-dictionary-url=http://127.0.0.1:1323]
[-cache-dbpath=/path/to/cache.db]
[-cvss-over=7]
Expand Down Expand Up @@ -653,7 +654,9 @@ scan:
-containers-only
Scan concontainers Only. Default: Scan both of hosts and containers
-cve-dictionary-dbpath string
/path/to/sqlite3 (For get cve detail from cve.sqlite3)
/path/to/sqlite3 (For get cve detail from cve.sqlite3)
-cve-dictionary-dbtype string
DB type for fetching CVE dictionary (sqlite3 or mysql) (default "sqlite3")
-cve-dictionary-url string
http://CVE.Dictionary (default "http://127.0.0.1:1323")
-cvss-over float
Expand Down Expand Up @@ -869,6 +872,14 @@ optional = [
]
```

## Example: Use MySQL as a DB storage back-end

```
$ vuls scan \
-cve-dictionary-dbtype=mysql \
-cve-dictionary-dbpath="user:pass@tcp(localhost:3306)/dbname?parseTime=true"
```

----

# Usage: Scan vulnerability of non-OS package
Expand Down Expand Up @@ -1028,89 +1039,14 @@ $ vuls scan -cve-dictionary-url=http://192.168.0.1:1323

# Usage: Update NVD Data

```
$ go-cve-dictionary fetchnvd -h
fetchnvd:
fetchnvd
[-last2y]
[-dbpath=/path/to/cve.sqlite3]
[-debug]
[-debug-sql]

-dbpath string
/path/to/sqlite3 (default "$PWD/cve.sqlite3")
-debug
debug mode
-debug-sql
SQL debug mode
-last2y
Refresh NVD data in the last two years.
```

- Fetch data of the entire period

```
$ for i in {2002..2016}; do go-cve-dictionary fetchnvd -years $i; done
```

- Fetch data in the last 2 years

```
$ go-cve-dictionary fetchnvd -last2y
```
see [go-cve-dictionary#usage-fetch-nvd-data](https://github.com/kotakanbe/go-cve-dictionary#usage-fetch-nvd-data)

----

# レポートの日本語化

- JVNから日本語の脆弱性情報を取得
```
$ go-cve-dictionary fetchjvn -h
fetchjvn:
fetchjvn
[-latest]
[-last2y]
[-years] 1998 1999 ...
[-dbpath=$PWD/cve.sqlite3]
[-http-proxy=http://192.168.0.1:8080]
[-debug]
[-debug-sql]

-dbpath string
/path/to/sqlite3 (default "$PWD/cve.sqlite3")
-debug
debug mode
-debug-sql
SQL debug mode
-http-proxy string
http://proxy-url:port (default: empty)
-last2y
Refresh JVN data in the last two years.
-latest
Refresh JVN data for latest.
-years
Refresh JVN data of specific years.

```

- すべての期間の脆弱性情報を取得(10分未満)
```
$ for i in {1998..2016}; do go-cve-dictionary fetchjvn -years $i; done
```

- 2年分の情報を取得
```
$ go-cve-dictionary fetchjvn -last2y
```

- 最新情報のみ取得
```
$ go-cve-dictionary fetchjvn -latest
```
see [go-cve-dictionary#usage-fetch-jvn-data](https://github.com/kotakanbe/go-cve-dictionary#usage-fetch-jvn-data)

- 脆弱性情報の自動アップデート
Cronなどのジョブスケジューラを用いて実現可能。
-latestオプションを指定して夜間の日次実行を推奨。

## fetchnvd, fetchjvnの実行順序の注意

Expand Down Expand Up @@ -1144,17 +1080,19 @@ slack, emailは日本語対応済み TUIは日本語表示未対応
# Update Vuls With Glide

- Update go-cve-dictionary
If the DB schema was changed, please specify new SQLite3 DB file.
If the DB schema was changed, please specify new SQLite3 or MySQL DB file.
```
$ cd $GOPATH/src/github.com/kotakanbe/go-cve-dictionary
$ git pull
$ mv vendor /tmp/foo
$ make install
```

- Update vuls
```
$ cd $GOPATH/src/github.com/future-architect/vuls
$ git pull
$ mv vendor /tmp/bar
$ make install
```
- バイナリファイルは`$GOPARH/bin`以下に作成される
Expand Down
53 changes: 19 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ And also, SUDO with password is not supported for security reasons. So you have

Vuls requires the following packages.

- SQLite3
- SQLite3 or MySQL
- git
- gcc
- go v1.7.1 or later
Expand Down Expand Up @@ -284,7 +284,7 @@ see https://github.com/future-architect/vuls/tree/master/setup/docker
![Vuls-Architecture](img/vuls-architecture.png)

## [go-cve-dictinary](https://github.com/kotakanbe/go-cve-dictionary)
- Fetch vulnerability information from NVD and JVN(Japanese), then insert into SQLite3.
- Fetch vulnerability information from NVD and JVN(Japanese), then insert into SQLite3 or MySQL.

## Scanning Flow
![Vuls-Scan-Flow](img/vuls-scan-flow.png)
Expand Down Expand Up @@ -613,7 +613,8 @@ scan:
[-lang=en|ja]
[-config=/path/to/config.toml]
[-results-dir=/path/to/results]
[-cve-dictionary-dbpath=/path/to/cve.sqlite3]
[-cve-dictionary-dbtype=sqlite3|mysql]
[-cve-dictionary-dbpath=/path/to/cve.sqlite3 or mysql connection string]
[-cve-dictionary-url=http://127.0.0.1:1323]
[-cache-dbpath=/path/to/cache.db]
[-cvss-over=7]
Expand Down Expand Up @@ -660,7 +661,9 @@ scan:
-containers-only
Scan concontainers Only. Default: Scan both of hosts and containers
-cve-dictionary-dbpath string
/path/to/sqlite3 (For get cve detail from cve.sqlite3)
/path/to/sqlite3 (For get cve detail from cve.sqlite3)
-cve-dictionary-dbtype string
DB type for fetching CVE dictionary (sqlite3 or mysql) (default "sqlite3")
-cve-dictionary-url string
http://CVE.Dictionary (default "http://127.0.0.1:1323")
-cvss-over float
Expand Down Expand Up @@ -869,6 +872,14 @@ optional = [
]
```

## Example: Use MySQL as a DB storage back-end

```
$ vuls scan \
-cve-dictionary-dbtype=mysql \
-cve-dictionary-dbpath="user:pass@tcp(localhost:3306)/dbname?parseTime=true"
```

----

# Usage: Scan vulnerabilites of non-OS packages
Expand Down Expand Up @@ -1027,53 +1038,27 @@ $ vuls scan -cve-dictionary-url=http://192.168.0.1:1323

# Usage: Update NVD Data

```
$ go-cve-dictionary fetchnvd -h
fetchnvd:
fetchnvd
[-last2y]
[-dbpath=/path/to/cve.sqlite3]
[-debug]
[-debug-sql]
see [go-cve-dictionary#usage-fetch-nvd-data](https://github.com/kotakanbe/go-cve-dictionary#usage-fetch-nvd-data)

-dbpath string
/path/to/sqlite3 (default "$PWD/cve.sqlite3")
-debug
debug mode
-debug-sql
SQL debug mode
-last2y
Refresh NVD data in the last two years.
```

- Fetch data of the entire period

```
$ go-cve-dictionary fetchnvd -entire
```

- Fetch data in the last 2 years

```
$ go-cve-dictionary fetchnvd -last2y
```

----

# Update Vuls With Glide

- Update go-cve-dictionary
If the DB schema was changed, please specify new SQLite3 DB file.
If the DB schema was changed, please specify new SQLite3 or MySQL DB file.
```
$ cd $GOPATH/src/github.com/kotakanbe/go-cve-dictionary
$ git pull
$ mv vendor /tmp/foo
$ make install
```

- Update vuls
```
$ cd $GOPATH/src/github.com/future-architect/vuls
$ git pull
$ mv vendor /tmp/bar
$ make install
```
Binary file was built under $GOPARH/bin
Expand Down