diff --git a/.github/workflows/trivy-nightly-scan.yaml b/.github/workflows/trivy-nightly-scan.yaml new file mode 100644 index 000000000..64a9c69b6 --- /dev/null +++ b/.github/workflows/trivy-nightly-scan.yaml @@ -0,0 +1,34 @@ +name: Trivy Nightly Scan +on: + schedule: + - cron: '0 2 * * *' # run at 2 AM UTC + +jobs: + nightly-scan: + name: Trivy Scan nightly + strategy: + fail-fast: false + matrix: + # maintain the versions of etcd that need to be actively + # security scanned + versions: [v3.4.22, v3.5.6] + permissions: + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results + + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + image-ref: 'gcr.io/etcd-development/etcd:${{ matrix.versions }}' + severity: 'CRITICAL,HIGH' + format: 'template' + template: '@/contrib/sarif.tpl' + output: 'trivy-results.sarif' + + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: 'trivy-results.sarif' \ No newline at end of file