2023-11-05 14:00:24 +00: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-06-19 11:06:58 +00:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
|
2023-11-05 14:00:24 +00:00
|
|
|
|
|
|
|
- name: Run Trivy vulnerability scanner
|
2024-07-25 18:24:27 +00:00
|
|
|
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # v0.24.0
|
2023-11-05 14:00:24 +00: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-06-19 11:06:58 +00:00
|
|
|
uses: github/codeql-action/upload-sarif@2bbafcdd7fbf96243689e764c2f15d9735164f33 # v3.25.10
|
2023-11-05 14:00:24 +00:00
|
|
|
with:
|
|
|
|
sarif_file: 'trivy-results.sarif'
|