Skip to content

Trivy

Trivy #160

Workflow file for this run

name: Trivy
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
branch:
description: 'branch to run scans on'
default: 'main'
type: string
env:
BUILD_TYPE: Release
MTL_BUILD_DISABLE_PCAPNG: true
PREFIX_DIR: /usr/local
DEBIAN_FRONTEND: noninteractive
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db
TRIVY_JAVA_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-java-db
permissions:
contents: read
jobs:
triv-security-tab:
name: sarif output scan
runs-on: ubuntu-20.04
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}
- name: Run Trivy vulnerability scanner with sarif output
uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # v0.28.0
with:
scan-type: config
scan-ref: ./docker
format: sarif
exit-code: 0
vuln-type: os,library
output: Trivy-dockerfile.sarif
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
with:
sarif_file: Trivy-dockerfile.sarif
trivy-stdout:
name: table output scan
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}
- name: Run Trivy vulnerability scanner with table output
uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # v0.28.0
with:
scan-type: config
scan-ref: ./docker
cache: false
format: table
exit-code: 1
vuln-type: os,library