-
Notifications
You must be signed in to change notification settings - Fork 9
85 lines (75 loc) · 2.58 KB
/
tryvi-trufflehog-default-security-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
name: Build and Scan Docker Images with Trivy && Trufflehog
on:
push:
branches-ignore:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-scan-images-for-vulnerabilities:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
## Alpine
### Alpine 3.18
- context: "alpine/3.18/8.1"
dockerfile: "Dockerfile"
tags: "8.1-alpine3.18"
platforms: "linux/amd64"
- context: "alpine/3.18/8.2"
dockerfile: "Dockerfile"
tags: "8.2-alpine3.18"
platforms: "linux/amd64"
- context: "alpine/3.18/8.3"
dockerfile: "Dockerfile"
tags: "8.3-alpine3.18"
platforms: "linux/amd64"
### Alpine 3.19
- context: "alpine/3.19/8.1"
dockerfile: "Dockerfile"
tags: "8.1-alpine3.19"
platforms: "linux/amd64"
- context: "alpine/3.19/8.2"
dockerfile: "Dockerfile"
tags: "8.2-alpine3.19"
platforms: "linux/amd64"
- context: "alpine/3.19/8.3"
dockerfile: "Dockerfile"
tags: "8.3-alpine3.19"
platforms: "linux/amd64"
### Alpine 3.20
- context: "alpine/3.20/8.1"
dockerfile: "Dockerfile"
tags: "8.1-alpine3.20"
platforms: "linux/amd64"
- context: "alpine/3.20/8.2"
dockerfile: "Dockerfile"
tags: "8.2-alpine3.20"
platforms: "linux/amd64"
- context: "alpine/3.20/8.3"
dockerfile: "Dockerfile"
tags: "8.3-alpine3.20"
platforms: "linux/amd64"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build Docker image
run: |
docker build --platform ${{ matrix.platforms }} -t spryker/php:${{ matrix.tags }} -f ${{ matrix.context }}/${{ matrix.dockerfile }} .
- name: Scan Docker image with Trufflehog
continue-on-error: false
run: |
docker run --rm trufflesecurity/trufflehog:latest docker --image spryker/php:${{ matrix.tags }} --only-verified
- name: Scan Docker image with Trivy
uses: aquasecurity/[email protected]
with:
image-ref: "spryker/php:${{ matrix.tags }}"
exit-code: '1'
severity: 'LOW,MEDIUM,HIGH,CRITICAL'
ignore-unfixed: true
- name: Show scan result
run: |
echo "Trivy scan completed for spryker/php:${{ matrix.tags }}"