GithubHelp home page GithubHelp logo

usr42 / clair-container-scan Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 5.0 3.14 MB

Automatically scan all local docker containers with Clair Vulnerability Scanner(https://github.com/coreos/clair) using Clair-Scanner(https://github.com/arminc/clair-scanner)

License: BSD 3-Clause "New" or "Revised" License

Shell 94.35% Dockerfile 5.65%

clair-container-scan's Introduction

Clair container scan

Anchore Image Overview

Overview

Automatically scan a particular local docker image or all local docker containers with Clair Vulnerability Scanner using Clair-Scanner and clair-local-scan.

Prerequisites

  • docker (1.12 or newer)
  • docker-compose (1.9.0 or newer)

Quick start

Scan all local containers

To get json output of the clair scan of all running containers to standard out just run:

./clair-container-scan.sh -p

The output will be empty and the return code will be zero, if no CVE was found. If there are findings, the output will list details in json.

You should always add the -p flag to get the latest CVE database version. You can use the -v flag to add verbose output, in case of a problem.

Scan a particular local image

To scan one particular local image just specify the image name as parameter:

# To scan alpine:3.4 run:
./clair-container-scan.sh -p alpine:3.4

The output will be empty and the return code will be zero, if no CVE was found.

If there are findings, the output will list details in json.

Integration in CI/CD

The easiest (but not most secure way) of integrating into your CI/CD tool is to run following one-liner (replace alpine:3.4 with the image you want to scan):

# to scan alpine:3.4 again
curl -s https://raw.githubusercontent.com/usr42/clair-container-scan/master/clair-container-scan.sh | sh -s -- alpine:3.4

WARNING: You should never pipe a remote-script directly into a shell, unless you completely trust the source and integrity of the file to execute. Usually, it is better to download the file, validate its input, and run you local, validated version.

Credits

clair-container-scan's People

Contributors

usr42 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

clair-container-scan's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.