2023-11-05 15:00:24 +01:00
|
|
|
name: trivy
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
pull_request:
|
|
|
|
branches: [ "main" ]
|
|
|
|
schedule:
|
2024-10-11 18:42:40 +02:00
|
|
|
- cron: '08 11 * * *'
|
2023-11-05 15:00:24 +01:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
trivy-scan:
|
2024-10-11 18:42:40 +02:00
|
|
|
# Only run this in the master repo and not on forks
|
|
|
|
# When all forks run this at the same time, it is causing `Too Many Requests` issues
|
|
|
|
if: ${{ github.repository == 'dani-garcia/vaultwarden' }}
|
2023-11-05 15:00:24 +01:00
|
|
|
name: Check
|
2024-08-13 12:52:07 +02:00
|
|
|
runs-on: ubuntu-24.04
|
2023-11-05 15:00:24 +01:00
|
|
|
timeout-minutes: 30
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
security-events: write
|
|
|
|
actions: read
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-10-11 18:42:40 +02:00
|
|
|
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1
|
2023-11-05 15:00:24 +01:00
|
|
|
|
|
|
|
- name: Run Trivy vulnerability scanner
|
2024-10-11 18:42:40 +02:00
|
|
|
uses: aquasecurity/trivy-action@5681af892cd0f4997658e2bacc62bd0a894cf564 # v0.27.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-10-11 18:42:40 +02:00
|
|
|
uses: github/codeql-action/upload-sarif@2bbafcdd7fbf96243689e764c2f15d9735164f33 # v3.26.6
|
2023-11-05 15:00:24 +01:00
|
|
|
with:
|
|
|
|
sarif_file: 'trivy-results.sarif'
|