-
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (33 loc) · 1.09 KB
/
trivy-scan-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Trivy Scan Image (schedule)
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
schedule:
- cron: '30 6 * * *'
env:
REGISTRY_URL: ghcr.io
IMAGE_USER: djerfy
IMAGE_NAME: bonjourmadame-api-server
IMAGE_TAG: latest
jobs:
vulnerability-scanner:
name: Vulnerability Scanner
runs-on: ubuntu-latest
steps:
- name: Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
if: github.event_name != 'pull_request'
with:
image-ref: '${{ env.REGISTRY_URL }}/${{ env.IMAGE_USER }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}'
format: 'sarif'
output: 'trivy-results.sarif'
ignore-unfixed: 'true'
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
- name: Trivy upload scan results
uses: github/codeql-action/upload-sarif@v3
if: github.event_name != 'pull_request'
with:
sarif_file: 'trivy-results.sarif'