Code Monkey home page Code Monkey logo

bp-trivy-step's Introduction

BP-TRIVY-STEP

A BP step to orchestrate trivy execution

Setup

  • Clone the code available at BP-TRIVY-STEP
  • Build the docker image
git submodule init
git submodule update
docker build -t ot/trivy:0.1 .

Testing

This section will give you a walkthrough of how you can use this image to do various types of testing Some of the global environment variables that control the behaviour of scanning

  • SCAN_SEVERITY | Default - HIGH,CRITICAL | For possible values check documentation
  • FORMAT_ARG | Default - html | For possible values check documentation
  • OUTPUT_ARG | Default - trivy-report.html | Give any path as per your preference

Docker Image Scan

Docker image scan will scan a docker image, this BP step can be used independently and with BuildPiper as well If you want to use it independently you have to take care of below things * You have to set IMAGE_NAME env variable * You have to set IMAGE_TAG env variable * You have to mount /var/run/docker.sock * You have to set WORKSPACE env variable * You have to set CODEBASE_DIR env variable

  • Do local testing via image only
# Failed Scan
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/src -e WORKSPACE=/ -e CODEBASE_DIR=src -e IMAGE_NAME="ot/trivy" -e IMAGE_TAG=0.1 ot/trivy:0.1
# Successful Scan
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/src -e WORKSPACE=/ -e CODEBASE_DIR=src -e IMAGE_NAME="ot/trivy" -e IMAGE_TAG=0.1 -e SCAN_SEVERITY="CRITICAL" ot/trivy:0.1

Filesystem Scan

Filesystem scan will scan a filesystem, this BP step can be used independently and with BuildPiper as well

# Successful Scan
docker run -it --rm -v $PWD:/src -e WORKSPACE=/ -e CODEBASE_DIR=src -e SCANNER=FILESYSTEM ot/trivy:0.1
  • Debugging
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v $PWD:/src -e WORKSPACE=/ -e CODEBASE_DIR=src -e IMAGE_NAME="ot/trivy" -e IMAGE_TAG=0.1 --entrypoint bash ot/trivy:0.1

Reference

bp-trivy-step's People

Contributors

cpriyanshi07 avatar cpriyanshi77 avatar sandy724 avatar

Watchers

 avatar

bp-trivy-step'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.