-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (43 loc) · 1.45 KB
/
scheduled-container-scanning.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
name: Scheduled docker container scan
on:
schedule:
- cron: "0 21 * * 1-5"
workflow_dispatch:
env:
ZAC_IMAGE_URL: 'ghcr.io/infonl/zaakafhandelcomponent:latest'
permissions:
security-events: write
jobs:
build:
name: Run docker scan
runs-on: ubuntu-22.04
steps:
- name: Pull Docker Image
run: docker pull ${{ env.ZAC_IMAGE_URL }}
- name: Run Trivy Vulnerability Scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ env.ZAC_IMAGE_URL }}
format: 'sarif'
output: 'trivy-results.sarif'
# limit the severities even when using Sarif
# or else all vulnerabilities will be reported
limit-severities-for-sarif: true
severity: 'CRITICAL,HIGH'
- name: Upload Trivy Scan Results to GitHub Security Tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
- name: Run Snyk to check Docker image for vulnerabilities
continue-on-error: true
uses: snyk/actions/docker@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
sarif: true
image: ${{ env.ZAC_IMAGE_URL }}
args: --severity-threshold=high --sarif --sarif-file-output=snyk.sarif
- name: Upload Snyk Scan Results to GitHub Security Tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'snyk.sarif'