Docker Scan is a Command Line Interface to run vulnerability detection on your Dockerfiles and Docker images
Перейти к файлу
Guillaume Lours 0d679c7644 Add license headers to existing files
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2020-07-20 11:27:21 +02:00
.github/workflows Check license header during lint step in CI 2020-07-18 00:31:28 +02:00
cmd/docker-scan Add license headers to existing files 2020-07-20 11:27:21 +02:00
config Add license headers to existing files 2020-07-20 11:27:21 +02:00
e2e Add license headers to existing files 2020-07-20 11:27:21 +02:00
internal Add license headers to existing files 2020-07-20 11:27:21 +02:00
scripts/validate Add license headers to existing files 2020-07-20 11:27:21 +02:00
.dockerignore add docker-config to dockerignore & gitignore 2020-06-15 10:27:13 +02:00
.gitattributes Adding Windows CI 2020-06-10 12:00:38 +02:00
.gitignore add docker-config to dockerignore & gitignore 2020-06-15 10:27:13 +02:00
.golangci.yml Initialize CI 2020-05-27 12:59:40 +02:00
Dockerfile Add license headers to existing files 2020-07-20 11:27:21 +02:00
LICENSE Add validate command to check and add license header to files 2020-07-17 19:14:08 +02:00
Makefile Add license headers to existing files 2020-07-20 11:27:21 +02:00
README.md Rename project to scan-cli-plugin 2020-06-29 16:33:19 +02:00
builder.Makefile Add graceful ctrl-c signal handling, killing snyk if it happens 2020-07-09 11:32:15 +02:00
go.mod Check license header during lint step in CI 2020-07-18 00:31:28 +02:00
go.sum Check license header during lint step in CI 2020-07-18 00:31:28 +02:00
vars.mk Adding Windows CI 2020-06-10 12:00:38 +02:00

README.md

Nightly Build

docker-scan

Snyk CLI Plugin PoC

Install snyk

On macOS:

brew tap snyk/tap && brew install snyk

Other OSes: See their doc

How to build and install docker scan

  • You have make and go installed:
$ make install
  • You have only make and docker (of course):
$ make dbuild
$ cp bin/scan-cli-plugin ~/.docker/cli-plugins
  • You have only docker:
$ @docker build . --output type=local,dest=./bin --target scan

Now check it's working:

$ docker scan
"docker run" requires at least 1 argument.
See 'docker scan --help'.

How to use it

First you need to authenticate to snyk.

  • Using snyk CLI
$ snyk auth

It opens a browser page, you need to login, eventually using your github account.

  • You can then use docker scan DOCKER_IMAGE:
$ docker scan hello-world

Testing hello-world...

Organization:      silvin-lubecki
Package manager:   linux
Project name:      docker-image|hello-world
Docker image:      hello-world
Licenses:          enabled

✓ Tested 0 dependencies for known issues, no vulnerable paths found.

Note that we do not currently have vulnerability data for your image.
  • Authenticate using docker scan --auth SNYK_AUTH_TOKEN DOCKER_IMAGE. You need first to get your API token
$ docker scan --auth c68dc480-27bd-45ee-9f5c-XXXXXXXXXXXX hello-world
Authenticating to Snyk using c68dc480-27bd-45ee-9f5c-XXXXXXXXXXXX

Your account has been authenticated. Snyk is now ready to be used.


Authenticated


Testing hello-world...

Organization:      silvin-lubecki
Package manager:   linux
Project name:      docker-image|hello-world
Docker image:      hello-world
Licenses:          enabled

✓ Tested 0 dependencies for known issues, no vulnerable paths found.

Note that we do not currently have vulnerability data for your image.

Run end-to-end tests

You need to get a valid Snyk token and put it in the E2E_TEST_AUTH_TOKEN env variable.

$ E2E_TEST_AUTH_TOKEN=XXXXXX make e2e

⚠️ If you want the github actions to run on your fork, you need to define a new Github secret E2E_TEST_AUTH_TOKEN with your Snyk token.