Code Monkey home page Code Monkey logo

scan-action's Introduction

GitHub Action: NeuVector Vulnerability Scan Action

Scans a container image for vulnerabilities with NeuVector

GitHub Release GitHub Marketplace License

Usage

Scan locally built container image

name: build
on:
  push:
    branches:
      - main
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Build image
        run: |
          docker build -t registry.organization.com/org/image-name:${{ github.sha }} .
      - name: Scan Image
        uses: neuvector/scan-action@main
        with:
          image-repository: registry.organization.com/org/image-name
          image-tag: ${{ github.sha }}
          min-high-cves-to-fail: "1"
          min-medium-cves-to-fail: "1"

Scan image from remote registry

name: build
on:
  push:
    branches:
      - main
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Scan Remote Image
        uses: neuvector/scan-action@main
        with:
          image-registry: https://registry.organization.com/
          image-registry-username: ${{ secrets.RegistryUsername }}
          image-registry-password: ${{ secrets.RegistryPassword }}
          image-repository: org/image-name
          image-tag: 1.0.0
          min-high-cves-to-fail: "1"
          min-medium-cves-to-fail: "1"

Customizing

Inputs

The following inputs can be used in step.with:

Input Description Default Required
image-registry Registry of the image to scan, e.g. https://registry.organization.com/ false
image-registry-username Username for the registry authentication false
image-registry-password Password for the registry authentication false
image-repository Repository of the image to scan, e.g. org/image-name true
image-tag Tag of the image to scan, e.g. 1.0.0 true
min-high-cves-to-fail Minimum CVEs with high severity to fail the job 0 false
min-medium-cves-to-fail Minimum CVEs with medium severity to fail the job 0 false
cve-names-to-fail Comma-separated list of CVE names(without spaces between the entries) that make the job fail, e.g. `CVE-2021-4160,CVE-2022-0778 false
cve-names-to-exempt Comma-separated list of CVE names(without spaces between the entries) that exempt the job fail, e.g. `CVE-2021-4160,CVE-2022-0778 false
nv-scanner-image NeuVector Scanner image to use for scanning neuvector/scanner:latest false
output Output format, one of: text, json, csv text false
debug Debug mode, on of: true, false false false

Outputs

**Output** **Description** **Default** **Required**
vulnerability_count Number of found vulnerabilities undefined undefined
high_vulnerability_count Number of found vulnerabilities with high severity undefined undefined
medium_vulnerability_count Number of found vulnerabilities with medium severity undefined undefined

Usage

- uses: neuvector/scan-action@main
  with:
    # Registry of the image to scan, e.g. `https://registry.organization.com/`
    # Default:
    image-registry: ""

    # Username for the registry authentication
    # Default:
    image-registry-username: ""

    # Password for the registry authentication
    # Default:
    image-registry-password: ""

    # Repository of the image to scan, e.g. `org/image-name`
    image-repository: ""

    # Tag of the image to scan, e.g. `1.0.0`
    image-tag: ""

    # Minimum CVEs with high severity to fail the job
    # Default: 0
    min-high-cves-to-fail: ""

    # Minimum CVEs with medium severity to fail the job
    # Default: 0
    min-medium-cves-to-fail: ""

    # Comma-separated list of CVE names(without spaces between the entries) that make
    # the job fail, e.g. `CVE-2021-4160,CVE-2022-0778
    # Default:
    cve-names-to-fail: ""

    # Comma-separated list of CVE names(without spaces between the entries) that
    # exempt the job fail, e.g. `CVE-2021-4160,CVE-2022-0778
    # Default:
    cve-names-to-exempt: ""

    # NeuVector Scanner image to use for scanning
    # Default: neuvector/scanner:latest
    nv-scanner-image: ""

    # Output format, one of: `text`, `json`, `csv`
    # Default: text
    output: ""

    # Debug mode, on of: `true`, `false`
    # Default: false
    debug: ""

scan-action's People

Contributors

bashofmann avatar becitsthere avatar dependabot[bot] avatar garyduan avatar pohanhuangtw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.