-
Notifications
You must be signed in to change notification settings - Fork 21
93 lines (83 loc) · 2.83 KB
/
scan.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: scan
on:
workflow_run:
workflows: [docker_publish]
types: [completed]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
scan-python:
name: Scan Python official base image
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/workflows/scan/html.tpl
sparse-checkout-cone-mode: false
- name: Run Trivy vulnerability scanner for Python official image
uses: aquasecurity/[email protected]
with:
image-ref: "ghcr.io/jim60105/whisperx:no_model"
vuln-type: "os,library"
scanners: vuln
severity: "CRITICAL,HIGH"
format: "template"
template: "@.github/workflows/scan/html.tpl"
exit-code: '1'
ignore-unfixed: true
output: "trivy-results-python.html"
- name: Upload Artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: trivy-results-python
path: trivy-results-python.html
retention-days: 90
scan-ubi:
name: Scan Red Hat UBI base image
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/workflows/scan/html.tpl
sparse-checkout-cone-mode: false
- name: Run Trivy vulnerability scanner for UBI image
uses: aquasecurity/[email protected]
with:
image-ref: "ghcr.io/jim60105/whisperx:ubi-no_model"
vuln-type: "os,library"
scanners: vuln
severity: "CRITICAL,HIGH"
format: "template"
template: "@.github/workflows/scan/html.tpl"
ignore-unfixed: true
output: "trivy-results-ubi.html"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: trivy-results-ubi
path: trivy-results-ubi.html
retention-days: 90
- name: Run Trivy vulnerability scanner for UBI image (SARIF)
uses: aquasecurity/trivy-action@master
if: always()
with:
image-ref: "ghcr.io/jim60105/whisperx:ubi-no_model"
vuln-type: "os,library"
scanners: vuln
severity: "CRITICAL,HIGH"
format: 'sarif'
exit-code: '1'
ignore-unfixed: true
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: 'trivy-results.sarif'