Skip to content

Commit

Permalink
Allign trivy workflow to MCM pipeline (#998)
Browse files Browse the repository at this point in the history
ADD:
* alligs pipeline steps the same way as it is in
Media-Communication-Mesh repo
  • Loading branch information
zLukas authored Oct 17, 2024
1 parent 8f15ab3 commit 089ac11
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
branch:
description: 'branch to run scans on'
default: 'main'
type: string

env:
BUILD_TYPE: Release
Expand All @@ -20,6 +25,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}
- name: 'Install dependencies'
run: |
sudo apt-get update -y && \
Expand All @@ -36,18 +43,33 @@ jobs:
run: |
cd docker
docker build -t mtl:latest -f ubuntu.dockerfile ../
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
- name: Run Trivy vulnerability scanner with sarif output
uses: aquasecurity/trivy-action@7c2007bcb556501da015201bcba5aa14069b74e2 # v0.23.0
with:
image-ref: 'mtl:latest'
format: 'sarif'
exit-code: '0'
ignore-unfixed: true
vuln-type: 'os,library'
output: 'Trivy-image-scan-results.sarif'
- name: Run Trivy vulnerability scanner with with table output
if: always()
uses: aquasecurity/trivy-action@7c2007bcb556501da015201bcba5aa14069b74e2 # v0.23.0
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'
- name: Upload Trivy scan results to GitHub Security tab
if: always()
uses: github/codeql-action/upload-sarif@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with:
sarif_file: 'Trivy-image-scan-results.sarif'
- uses: actions/upload-artifact@v4
if: always()
with:
name: trivy-output
name: trivy-results
path: 'Trivy-image-scan-results.txt'

0 comments on commit 089ac11

Please sign in to comment.