-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from hikachan/repo01
Improve setup/docker
- Loading branch information
Showing
22 changed files
with
389 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ vendor/ | |
log/ | ||
results/ | ||
*config.toml | ||
!setup/docker/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,106 @@ | ||
# Vuls on Docker | ||
# Vuls Docker components | ||
|
||
## What's Vuls-On-Docker | ||
This is the Git repo of the official Docker image for vuls. | ||
|
||
- This is a dockernized-Vuls with vulsrepo UI in it. | ||
- It's designed to reduce the cost of installation and the dependencies that vuls requires. | ||
- You can run install and run Vuls on your machine with only a few commands. | ||
- The result can be viewed with a browser | ||
# Supported tags and respective `Dockerfile` links | ||
|
||
## Setting up your machine | ||
|
||
1. [Install Docker](https://docs.docker.com/engine/installation/) | ||
2. [Install Docker-Compose](https://docs.docker.com/compose/install/) | ||
3. Make sure that you can run the following commands before you move on. | ||
- go-cve-dictionary | ||
- [`latest` (*go-cve-dictionary:latest Dockerfile*)]() | ||
- vuls | ||
- [`latest` (*vuls:latest Dockerfile*)]() | ||
- vulsrepo | ||
- [`latest` (*vulsrepo:latest Dockerfile*)]() | ||
|
||
``` | ||
$ docker version | ||
$ docker-compose version | ||
``` | ||
|
||
4. git clone vuls | ||
``` | ||
mkdir work | ||
cd work | ||
git clone https://github.com/future-architect/vuls.git | ||
cd vuls/setup/docker | ||
``` | ||
This image version is same as the github repository version. | ||
|
||
# How to use this image | ||
|
||
1. fetch nvd (vuls/go-cve-dictionary) | ||
1. configuration (vuls/vuls) | ||
1. prepare (vuls/vuls) | ||
1. scan (vuls/vuls) | ||
1. vulsrepo (vuls/vulsrepo) | ||
|
||
## Start A Vuls Container | ||
## Step1. Fetch NVD | ||
|
||
- Execute the following command to build and run a Vuls Container | ||
```console | ||
$ for i in {2002..2016}; do \ | ||
docker run --rm -it \ | ||
-v $PWD:/vuls vuls/go-cve-dictionary fetchnvd -years $i; \ | ||
done | ||
``` | ||
|
||
``` | ||
$ docker-compose up -d | ||
``` | ||
## Step2. Configuration | ||
|
||
## Setting up Vuls | ||
Create config.toml referring to [this](https://github.com/future-architect/vuls#configuration). | ||
|
||
1. Locate ssh-keys of target servers in (vuls/setup/docker/conf/) | ||
2. Create and adjust config.toml(vuls/setup/docker/conf/config.toml) to your environment | ||
|
||
``` | ||
[servers] | ||
```toml | ||
[servers] | ||
|
||
[servers.172-31-4-82] | ||
host = "172.31.4.82" | ||
user = "ec2-user" | ||
keyPath = "conf/id_rsa" | ||
``` | ||
[servers.amazon] | ||
host = "54.249.93.16" | ||
port = "22" | ||
user = "vuls-user" | ||
keyPath = "/root/.ssh/id_rsa" # path to ssh private key in docker | ||
``` | ||
|
||
|
||
```console | ||
$ docker run --rm \ | ||
-v ~/.ssh:/root/.ssh:ro \ | ||
-v $PWD:/vuls \ | ||
vuls/vuls configtest \ | ||
-config=./config.toml # path to config.toml in docker | ||
``` | ||
|
||
## Fetch Vulnerability database | ||
## Step3. Prepare | ||
|
||
- Fetch Vulnerability database from NVD | ||
``` | ||
$ docker exec -t vuls scripts/fetch_nvd_all.sh | ||
``` | ||
```console | ||
$ docker run --rm \ | ||
-v ~/.ssh:/root/.ssh:ro \ | ||
-v $PWD:/vuls \ | ||
vuls/vuls prepare \ | ||
-config=./config.toml # path to config.toml in docker | ||
``` | ||
|
||
## Scan servers with Vuls-On-Docker | ||
## Step4. Scan | ||
|
||
```console | ||
$ docker run --rm -it \ | ||
-v ~/.ssh:/root/.ssh:ro \ | ||
-v $PWD:/vuls \ | ||
-v /etc/localtime:/etc/localtime:ro \ | ||
-e "TZ=Asia/Tokyo" \ | ||
vuls/vuls scan \ | ||
-cve-dictionary-dbpath=/vuls/cve.sqlite3 \ | ||
-config=./config.toml \ # path to config.toml in docker | ||
-report-json | ||
``` | ||
|
||
- Use the embedded script to scan servers for vulsrepo(or run whatever with docker exec) | ||
## Step5. vulsrepo | ||
|
||
``` | ||
$ docker exec -t vuls vuls prepare -config=conf/config.toml | ||
$ docker exec -t vuls scripts/scan_for_vulsrepo.sh | ||
``` | ||
```console | ||
$docker run -dt \ | ||
-v $PWD:/vuls \ | ||
-p 80:80 \ | ||
vuls/vulsrepo | ||
``` | ||
|
||
## See the results in a browser | ||
# User Feedback | ||
|
||
``` | ||
http://${Vuls_Host}/vulsrepo/ | ||
``` | ||
## Documentation | ||
|
||
Documentation for this image is stored in the [`docker/` directory]() of the [`future-architect/vuls` GitHub repo](https://github.com/future-architect/vuls). | ||
|
||
# Update modules | ||
## Issues | ||
|
||
- update vuls, go-cve-dictionary, vulsrepo | ||
``` | ||
$ docker exec -t vuls scripts/update_modules.sh | ||
``` | ||
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). | ||
|
||
# Update Vulnerability database | ||
## Contributing | ||
|
||
- Fetch Vulnerability database from NVD | ||
``` | ||
$ docker exec -t vuls scripts/fetch_nvd_last2y.sh | ||
``` | ||
1. fork a repository: github.com/future-architect/vuls to github.com/you/repo | ||
1. get original code: go get github.com/future-architect/vuls | ||
1. work on original code | ||
1. add remote to your repo: git remote add myfork https://github.com/you/repo.git | ||
1. push your changes: git push myfork | ||
1. create a new Pull Request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM golang:1.7.1 | ||
|
||
MAINTAINER hikachan sadayuki-matsuno | ||
|
||
# glide install | ||
ENV GLIDE_VERSION 0.12.2 | ||
ENV GLIDE_DOWNLOAD_URL https://github.com/Masterminds/glide/releases/download/v$GLIDE_VERSION/glide-v$GLIDE_VERSION-linux-amd64.tar.gz | ||
RUN curl -fsSL "$GLIDE_DOWNLOAD_URL" -o glide.tar.gz \ | ||
&& mkdir /usr/local/glide \ | ||
&& tar -C /usr/local/glide -xzf glide.tar.gz \ | ||
&& ln -s /usr/local/glide/linux-amd64/glide /usr/local/bin/ \ | ||
&& rm glide.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Vuls-Base-Docker | ||
|
||
This is the Git repo of the official Docker image for vuls-base. | ||
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. | ||
|
||
# Supported tags and respective `Dockerfile` links | ||
|
||
- [`0.1.0`, `latest` (*vuls-base:0.1.0 Dockerfile*)]() | ||
|
||
|
||
# What is vuls-base? | ||
|
||
Base images of vuls and go-cve-dictionary. | ||
|
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.