Skip to content

Trivy

Trivy #3

Workflow file for this run

name: Trivy
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
env:
BUILD_TYPE: Release
MTL_BUILD_DISABLE_PCAPNG: true
PREFIX_DIR: /usr/local
DEBIAN_FRONTEND: noninteractive
permissions:
contents: read
jobs:
trivy:
name: Build
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: 'Install dependencies'
run: |
sudo apt-get update -y && \
sudo apt-get install -y --no-install-recommends \
git build-essential meson python3 python3-pyelftools pkg-config \
libnuma-dev libjson-c-dev libpcap-dev libgtest-dev libsdl2-dev \
libsdl2-ttf-dev libssl-dev ca-certificates m4 clang llvm zlib1g-dev \
libelf-dev libcap-ng-dev libcap2-bin gcc-multilib systemtap-sdt-dev ninja-build \
nasm dpdk-dev librdmacm-dev && \
sudo apt-get clean && \
sudo rm -rf /var/lib/apt/lists/*
- name: Build an image from Dockerfile
run: |
cd docker
docker build -t mtl:latest -f ubuntu.dockerfile ../
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: 'mtl:latest'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
output: 'Trivy-image-scan-results.txt'
- uses: actions/upload-artifact@v4
with:
name: trivy-output
path: 'Trivy-image-scan-results.txt'