2023-11-05 15:00:24 +01:00
|
|
|
name: trivy
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
pull_request:
|
|
|
|
branches: [ "main" ]
|
|
|
|
schedule:
|
|
|
|
- cron: '00 12 * * *'
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
trivy-scan:
|
|
|
|
name: Check
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
timeout-minutes: 30
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
security-events: write
|
|
|
|
actions: read
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-04-27 00:53:42 +02:00
|
|
|
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b #v4.1.4
|
2023-11-05 15:00:24 +01:00
|
|
|
|
|
|
|
- name: Run Trivy vulnerability scanner
|
2024-04-27 00:53:42 +02:00
|
|
|
uses: aquasecurity/trivy-action@d710430a6722f083d3b36b8339ff66b32f22ee55 # v0.19.0
|
2023-11-05 15:00:24 +01:00
|
|
|
with:
|
|
|
|
scan-type: repo
|
|
|
|
ignore-unfixed: true
|
|
|
|
format: sarif
|
|
|
|
output: trivy-results.sarif
|
|
|
|
severity: CRITICAL,HIGH
|
|
|
|
|
|
|
|
- name: Upload Trivy scan results to GitHub Security tab
|
2024-04-27 00:53:42 +02:00
|
|
|
uses: github/codeql-action/upload-sarif@2bbafcdd7fbf96243689e764c2f15d9735164f33 # v3.25.3
|
2023-11-05 15:00:24 +01:00
|
|
|
with:
|
|
|
|
sarif_file: 'trivy-results.sarif'
|