Skip to content

Security checks

Security checks #52

Workflow file for this run

name: Security checks
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '0 8 * * 1'
jobs:
test-trivy:
name: Analyze the Matchbox image with Trivy
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout the repository
uses: actions/checkout@main
# We will scan the Matchbox image used in the Dockerfile with Trivy.
# The Trivy scan is also enabled in Matchbox repository, but only for the latest version.
# If a new vulnerability is discovered in a previous release that is still used here, we will catch it.
- name: Extract the image name from the Dockerfile
run: echo "image_name=$(awk '/FROM ([a-zA-Z0-9\.\-/:]+)/ { print $2 }' Dockerfile)" >> "$GITHUB_ENV"
- name: Run Trivy vulnerability scanner in image mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'image'
image-ref: ${{ env.image_name }}
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@main
if: always()
with:
sarif_file: 'trivy-results.sarif'