-
Notifications
You must be signed in to change notification settings - Fork 20
92 lines (80 loc) · 2.99 KB
/
vulnerabilities.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
name: Scan Vulnerabilities
on:
schedule:
- cron: '30 9 * * 1'
permissions:
contents: read
jobs:
scan-docker-images:
permissions:
actions: read
contents: read
security-events: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
tags: true
- name: Run Trivy (client:dev)
uses: aquasecurity/[email protected]
with:
image-ref: "ghcr.io/diracgrid/diracx/client:dev"
format: "sarif"
output: "client-dev-vulnerability-report.sarif"
- name: Upload SARIF to GitHub Security (client:dev)
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "client-dev-vulnerability-report.sarif"
category: "client-dev"
- name: Run Trivy (services:dev)
uses: aquasecurity/[email protected]
with:
image-ref: "ghcr.io/diracgrid/diracx/services:dev"
format: "sarif"
output: "services-dev-vulnerability-report.sarif"
skip-setup-trivy: true
- name: Upload SARIF to GitHub Security (services:dev)
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "services-dev-vulnerability-report.sarif"
category: "services-dev"
- name: Get Latest Release Tag
id: get-latest-tag
run: |
tag=$(git rev-list --tags --max-count=1 --date-order)
if [ -z "$tag" ]; then
echo "latest_tag=" >> $GITHUB_OUTPUT
else
latest_tag=$(git describe --tags "$tag")
echo "latest_tag=${latest_tag}" >> $GITHUB_OUTPUT
fi
- name: Run Trivy (client:release)
if: ${{ steps.get-latest-tag.outputs.latest_tag != '' }}
uses: aquasecurity/[email protected]
with:
image-ref: "ghcr.io/diracgrid/diracx/client:${{ steps.get-latest-tag.outputs.latest_tag }}"
format: "sarif"
output: "client-rel-vulnerability-report.sarif"
skip-setup-trivy: true
- name: Upload SARIF to GitHub Security (client:rel)
if: ${{ steps.get-latest-tag.outputs.latest_tag != '' }}
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "client-rel-vulnerability-report.sarif"
category: "client-rel"
- name: Run Trivy (services:release)
if: ${{ steps.get-latest-tag.outputs.latest_tag != '' }}
uses: aquasecurity/[email protected]
with:
image-ref: "ghcr.io/diracgrid/diracx/services:${{ steps.get-latest-tag.outputs.latest_tag }}"
format: "sarif"
output: "services-rel-vulnerability-report.sarif"
skip-setup-trivy: true
- name: Upload SARIF to GitHub Security (services:rel)
if: ${{ steps.get-latest-tag.outputs.latest_tag != '' }}
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "services-rel-vulnerability-report.sarif"
category: "services-rel"