-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allign trivy workflow to MCM pipeline (#998)
ADD: * alligs pipeline steps the same way as it is in Media-Communication-Mesh repo
- Loading branch information
Showing
1 changed file
with
27 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 && \ | ||
|
@@ -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' |