Skip to content

Commit c2eab87

Browse files
fix docker
1 parent ac6fe6f commit c2eab87

22 files changed

+389
-303
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ vendor/
1212
log/
1313
results/
1414
*config.toml
15+
!setup/docker/*

README.ja.md

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ Vulsは上に挙げた手動運用での課題を解決するツールであり
6565
Vulsのセットアップは以下の3パターンがある
6666

6767
- Dockerコンテナ上にセットアップ
68-
Docker Composeを用いて少ないコマンドでセットアップ可能
6968
see https://github.com/future-architect/vuls/tree/master/setup/docker
7069
[日本語README](https://github.com/future-architect/vuls/blob/master/setup/docker/README.ja.md)
7170
- Chefでセットアップ

setup/docker/README.ja.md

-101
This file was deleted.

setup/docker/README.md

+83-64
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,106 @@
1-
# Vuls on Docker
1+
# Vuls Docker components
22

3-
## What's Vuls-On-Docker
3+
This is the Git repo of the official Docker image for vuls.
44

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
96

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*)]()
1513

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.
2815

16+
# How to use this image
2917

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)
3023

31-
## Start A Vuls Container
24+
## Step1. Fetch NVD
3225

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+
```
3432

35-
```
36-
$ docker-compose up -d
37-
```
33+
## Step2. Configuration
3834

39-
## Setting up Vuls
35+
Create config.toml referring to [this](https://github.com/future-architect/vuls#configuration).
4036

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]
4639

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+
```
5255

53-
## Fetch Vulnerability database
56+
## Step3. Prepare
5457

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+
```
5965

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+
```
6179

62-
- Use the embedded script to scan servers for vulsrepo(or run whatever with docker exec)
80+
## Step5. vulsrepo
6381

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+
```
6888

69-
## See the results in a browser
89+
# User Feedback
7090

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).
7494

75-
# Update modules
95+
## Issues
7696

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).
8198

82-
# Update Vulnerability database
99+
## Contributing
83100

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

setup/docker/base/latest/Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM golang:1.7.1
2+
3+
MAINTAINER hikachan sadayuki-matsuno
4+
5+
# glide install
6+
ENV GLIDE_VERSION 0.12.2
7+
ENV GLIDE_DOWNLOAD_URL https://github.com/Masterminds/glide/releases/download/v$GLIDE_VERSION/glide-v$GLIDE_VERSION-linux-amd64.tar.gz
8+
RUN curl -fsSL "$GLIDE_DOWNLOAD_URL" -o glide.tar.gz \
9+
&& mkdir /usr/local/glide \
10+
&& tar -C /usr/local/glide -xzf glide.tar.gz \
11+
&& ln -s /usr/local/glide/linux-amd64/glide /usr/local/bin/ \
12+
&& rm glide.tar.gz

setup/docker/base/latest/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Vuls-Base-Docker
2+
3+
This is the Git repo of the official Docker image for vuls-base.
4+
See the [Hub page](https://hub.docker.com/r/vuls/vuls-base/) for the full readme on how to use the Docker image and for information regarding contributing and issues.
5+
6+
# Supported tags and respective `Dockerfile` links
7+
8+
- [`0.1.0`, `latest` (*vuls-base:0.1.0 Dockerfile*)]()
9+
10+
11+
# What is vuls-base?
12+
13+
Base images of vuls and go-cve-dictionary.
14+

setup/docker/conf/.gitkeep

Whitespace-only changes.

setup/docker/docker-compose.yml

-11
This file was deleted.

setup/docker/dockerfile/Dockerfile

-73
This file was deleted.

0 commit comments

Comments
 (0)