Runs Trivy as GitHub action to scan your Docker container image for vulnerabilities
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Go to file
Daniel Pacak 1eb53c0425 docs: Update README.md
Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>
4 years ago
docs/images docs: Update README.md 4 years ago
.gitignore feat: Add exit-code to Trivy args (#1) 4 years ago
LICENSE docs: Add badges (#6) 4 years ago
README.md docs: Update README.md 4 years ago
action.yaml docs: Update README.md 4 years ago

README.md

Trivy Action

GitHub Action for Trivy

GitHub Release GitHub Marketplace License

Table of Contents

Usage

Workflow

name: build
on:
  push:
    branches:
      - master
  pull_request:
jobs:
  build:
    name: Build
    runs-on: ubuntu-18.04
    steps:
      - name: Setup Go
        uses: actions/setup-go@v1
        with:
          go-version: 1.14
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Build an image from Dockerfile
        run: |
                    docker build -t docker.io/my-organization/my-app:${{ github.sha }} .
      - name: Run vulnerability scanner
        uses: aquasecurity/trivy-action@0.0.5
        with:
          image-ref: 'docker.io/my-organization/my-app:${{ github.sha }}'
          format: 'table'
          exit-code: '1'
          severity: 'CRITICAL,HIGH'

Customizing

inputs

Following inputs can be used as step.with keys:

Name Type Default Description
image-ref String Image reference, e.g. alpine:3.10.2
format String table Output format (table, json)
exit-code String 0 Exit code when vulnerabilities were found
severity String UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL Severities of vulnerabilities to be displayed