|
1 |
| -# Vuls on Docker |
| 1 | +# Vuls Docker components |
2 | 2 |
|
3 |
| -## What's Vuls-On-Docker |
| 3 | +This is the Git repo of the official Docker image for vuls. |
4 | 4 |
|
5 |
| -- This is a dockernized-Vuls with vulsrepo UI in it. |
6 |
| -- It's designed to reduce the cost of installation and the dependencies that vuls requires. |
7 |
| -- You can run install and run Vuls on your machine with only a few commands. |
8 |
| -- The result can be viewed with a browser |
| 5 | +# Supported tags and respective `Dockerfile` links |
9 | 6 |
|
10 |
| -## Setting up your machine |
11 |
| - |
12 |
| -1. [Install Docker](https://docs.docker.com/engine/installation/) |
13 |
| -2. [Install Docker-Compose](https://docs.docker.com/compose/install/) |
14 |
| -3. Make sure that you can run the following commands before you move on. |
| 7 | +- go-cve-dictionary |
| 8 | + - [`latest` (*go-cve-dictionary:latest Dockerfile*)]() |
| 9 | +- vuls |
| 10 | + - [`latest` (*vuls:latest Dockerfile*)]() |
| 11 | +- vulsrepo |
| 12 | + - [`latest` (*vulsrepo:latest Dockerfile*)]() |
15 | 13 |
|
16 |
| - ``` |
17 |
| - $ docker version |
18 |
| - $ docker-compose version |
19 |
| - ``` |
20 |
| - |
21 |
| -4. git clone vuls |
22 |
| - ``` |
23 |
| - mkdir work |
24 |
| - cd work |
25 |
| - git clone https://github.com/future-architect/vuls.git |
26 |
| - cd vuls/setup/docker |
27 |
| - ``` |
| 14 | +This image version is same as the github repository version. |
28 | 15 |
|
| 16 | +# How to use this image |
29 | 17 |
|
| 18 | +1. fetch nvd (vuls/go-cve-dictionary) |
| 19 | +1. configuration (vuls/vuls) |
| 20 | +1. prepare (vuls/vuls) |
| 21 | +1. scan (vuls/vuls) |
| 22 | +1. vulsrepo (vuls/vulsrepo) |
30 | 23 |
|
31 |
| -## Start A Vuls Container |
| 24 | +## Step1. Fetch NVD |
32 | 25 |
|
33 |
| -- Execute the following command to build and run a Vuls Container |
| 26 | +```console |
| 27 | +$ for i in {2002..2016}; do \ |
| 28 | + docker run --rm -it \ |
| 29 | + -v $PWD:/vuls vuls/go-cve-dictionary fetchnvd -years $i; \ |
| 30 | + done |
| 31 | +``` |
34 | 32 |
|
35 |
| - ``` |
36 |
| - $ docker-compose up -d |
37 |
| - ``` |
| 33 | +## Step2. Configuration |
38 | 34 |
|
39 |
| -## Setting up Vuls |
| 35 | +Create config.toml referring to [this](https://github.com/future-architect/vuls#configuration). |
40 | 36 |
|
41 |
| -1. Locate ssh-keys of target servers in (vuls/setup/docker/conf/) |
42 |
| -2. Create and adjust config.toml(vuls/setup/docker/conf/config.toml) to your environment |
43 |
| - |
44 |
| - ``` |
45 |
| - [servers] |
| 37 | +```toml |
| 38 | +[servers] |
46 | 39 |
|
47 |
| - [servers.172-31-4-82] |
48 |
| - host = "172.31.4.82" |
49 |
| - user = "ec2-user" |
50 |
| - keyPath = "conf/id_rsa" |
51 |
| - ``` |
| 40 | +[servers.amazon] |
| 41 | +host = "54.249.93.16" |
| 42 | +port = "22" |
| 43 | +user = "vuls-user" |
| 44 | +keyPath = "/root/.ssh/id_rsa" # path to ssh private key in docker |
| 45 | +``` |
| 46 | + |
| 47 | + |
| 48 | +```console |
| 49 | +$ docker run --rm \ |
| 50 | + -v ~/.ssh:/root/.ssh:ro \ |
| 51 | + -v $PWD:/vuls \ |
| 52 | + vuls/vuls configtest \ |
| 53 | + -config=./config.toml # path to config.toml in docker |
| 54 | +``` |
52 | 55 |
|
53 |
| -## Fetch Vulnerability database |
| 56 | +## Step3. Prepare |
54 | 57 |
|
55 |
| -- Fetch Vulnerability database from NVD |
56 |
| - ``` |
57 |
| - $ docker exec -t vuls scripts/fetch_nvd_all.sh |
58 |
| - ``` |
| 58 | +```console |
| 59 | +$ docker run --rm \ |
| 60 | + -v ~/.ssh:/root/.ssh:ro \ |
| 61 | + -v $PWD:/vuls \ |
| 62 | + vuls/vuls prepare \ |
| 63 | + -config=./config.toml # path to config.toml in docker |
| 64 | +``` |
59 | 65 |
|
60 |
| -## Scan servers with Vuls-On-Docker |
| 66 | +## Step4. Scan |
| 67 | + |
| 68 | +```console |
| 69 | +$ docker run --rm -it \ |
| 70 | + -v ~/.ssh:/root/.ssh:ro \ |
| 71 | + -v $PWD:/vuls \ |
| 72 | + -v /etc/localtime:/etc/localtime:ro \ |
| 73 | + -e "TZ=Asia/Tokyo" \ |
| 74 | + vuls/vuls scan \ |
| 75 | + -cve-dictionary-dbpath=/vuls/cve.sqlite3 \ |
| 76 | + -config=./config.toml \ # path to config.toml in docker |
| 77 | + -report-json |
| 78 | +``` |
61 | 79 |
|
62 |
| -- Use the embedded script to scan servers for vulsrepo(or run whatever with docker exec) |
| 80 | +## Step5. vulsrepo |
63 | 81 |
|
64 |
| - ``` |
65 |
| - $ docker exec -t vuls vuls prepare -config=conf/config.toml |
66 |
| - $ docker exec -t vuls scripts/scan_for_vulsrepo.sh |
67 |
| - ``` |
| 82 | +```console |
| 83 | +$docker run -dt \ |
| 84 | + -v $PWD:/vuls \ |
| 85 | + -p 80:80 \ |
| 86 | + vuls/vulsrepo |
| 87 | +``` |
68 | 88 |
|
69 |
| -## See the results in a browser |
| 89 | +# User Feedback |
70 | 90 |
|
71 |
| -``` |
72 |
| -http://${Vuls_Host}/vulsrepo/ |
73 |
| -``` |
| 91 | +## Documentation |
| 92 | + |
| 93 | +Documentation for this image is stored in the [`docker/` directory]() of the [`future-architect/vuls` GitHub repo](https://github.com/future-architect/vuls). |
74 | 94 |
|
75 |
| -# Update modules |
| 95 | +## Issues |
76 | 96 |
|
77 |
| -- update vuls, go-cve-dictionary, vulsrepo |
78 |
| - ``` |
79 |
| - $ docker exec -t vuls scripts/update_modules.sh |
80 |
| - ``` |
| 97 | +If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/future-architect/vuls/issues). |
81 | 98 |
|
82 |
| -# Update Vulnerability database |
| 99 | +## Contributing |
83 | 100 |
|
84 |
| -- Fetch Vulnerability database from NVD |
85 |
| - ``` |
86 |
| - $ docker exec -t vuls scripts/fetch_nvd_last2y.sh |
87 |
| - ``` |
| 101 | +1. fork a repository: github.com/future-architect/vuls to github.com/you/repo |
| 102 | +1. get original code: go get github.com/future-architect/vuls |
| 103 | +1. work on original code |
| 104 | +1. add remote to your repo: git remote add myfork https://github.com/you/repo.git |
| 105 | +1. push your changes: git push myfork |
| 106 | +1. create a new Pull Request |
0 commit comments