-
Notifications
You must be signed in to change notification settings - Fork 55
92 lines (81 loc) · 2.68 KB
/
vulnerability-scan.yaml
File metadata and controls
92 lines (81 loc) · 2.68 KB
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
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Vulnerability Scan
on:
schedule:
- cron: 30 1 * * *
workflow_dispatch:
permissions:
contents: read
jobs:
grype:
name: Setup Grype
runs-on: ubuntu-latest
steps:
- name: Create Cache Key
id: cache
run: |-
echo "key=$(date -u +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Restore Database
id: database-restore
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
key: grype-db-${{ steps.cache.outputs.key }}
path: ~/.cache/grype/db
- if: ${{ always() && steps.database-restore.outputs.cache-hit != 'true' }}
name: Install Grype
uses: anchore/scan-action/download-grype@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # v7.4.0
id: grype
- if: ${{ always() && steps.database-restore.outputs.cache-hit != 'true' }}
name: Update Database
run: |-
${{ steps.grype.outputs.cmd }} db update
- if: ${{ always() && steps.database-restore.outputs.cache-hit != 'true' }}
name: Cache Database
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
key: grype-db-${{ steps.cache.outputs.key }}
path: ~/.cache/grype/db
vulnerability-scan:
name: Vulnerability Scan (${{ matrix.variant }})
needs:
- grype
runs-on: ubuntu-latest
strategy:
matrix:
include:
- variant: main
tag: latest
- variant: noml
tag: noml
- variant: cuda
tag: cuda
- variant: openvino
tag: openvino
max-parallel: 4
fail-fast: false
permissions:
security-events: write
contents: read
steps:
- name: Retreive Cache Key
id: cache
run: |-
echo "key=$(date -u +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Restore Database
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
key: grype-db-${{ steps.cache.outputs.key }}
path: ~/.cache/grype/db
- name: Scan
uses: anchore/scan-action@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # v7.4.0
id: scan
with:
fail-build: false
image: ghcr.io/${{ github.repository_owner }}/immich:${{ matrix.tag }}
severity-cutoff: high
- name: Upload Report
uses: github/codeql-action/upload-sarif@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4
with:
category: container:immich-${{ matrix.variant }}
sarif_file: ${{ steps.scan.outputs.sarif }}