-
Notifications
You must be signed in to change notification settings - Fork 31
104 lines (101 loc) · 3.49 KB
/
docker-verify.yaml
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
94
95
96
97
98
99
100
101
102
103
104
name: Docker verify process
on:
push:
paths:
- "Dockerfile-notebook"
- "Dockerfile-ray-node"
- "gateway/Dockerfile"
- "repository/Dockerfile"
- ".github/actions/docker-vscan/action.yaml"
- ".github/scripts/dockerfile-security.rego"
- ".github/workflows/docker-verify.yaml"
env:
HADOLINT_DOCKER_IMAGE: hadolint/hadolint:v2.12.0
OPENPOLICYAGENT_DOCKER_IMAGE: openpolicyagent/conftest:v0.43.1
jobs:
lint:
strategy:
matrix:
dockerfile:
[
"Dockerfile-notebook",
"Dockerfile-ray-node",
"./gateway/Dockerfile",
"./repository/Dockerfile",
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run hadolint in ${{ matrix.dockerfile }}
run: docker run --name hadolint --rm --interactive ${{ env.HADOLINT_DOCKER_IMAGE }} < ${{ matrix.dockerfile }}
sast:
strategy:
matrix:
dockerfile:
[
"Dockerfile-notebook",
"Dockerfile-ray-node",
"./gateway/Dockerfile",
"./repository/Dockerfile",
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run conftest in ${{ matrix.dockerfile }}
shell: bash
run: |
docker run \
--name conftest \
--rm --volume $GITHUB_WORKSPACE:/project ${{ env.OPENPOLICYAGENT_DOCKER_IMAGE }} \
test --strict --parser dockerfile \
--policy .github/scripts/dockerfile-security.rego \
${{ matrix.dockerfile }}
vscan:
strategy:
matrix:
image:
[
"quantum-serverless-gateway:latest",
"quantum-serverless-notebook:latest-py38",
"quantum-serverless-notebook:latest-py39",
"quantum-serverless-notebook:latest-py310",
"quantum-serverless-ray-node:latest-py38",
"quantum-serverless-ray-node:latest-py39",
"quantum-serverless-ray-node:latest-py310",
"quantum-repository-server:latest",
]
include:
- image: "quantum-serverless-gateway:latest"
dockerfile: "./gateway/Dockerfile"
pyversion: "3.9"
- image: "quantum-serverless-notebook:latest-py38"
dockerfile: "Dockerfile-notebook"
pyversion: "3.8"
- image: "quantum-serverless-notebook:latest-py39"
dockerfile: "Dockerfile-notebook"
pyversion: "3.9"
- image: "quantum-serverless-notebook:latest-py310"
dockerfile: "Dockerfile-notebook"
pyversion: "3.10"
- image: "quantum-serverless-ray-node:latest-py38"
dockerfile: "Dockerfile-ray-node"
pyversion: "py38"
- image: "quantum-serverless-ray-node:latest-py39"
dockerfile: "Dockerfile-ray-node"
pyversion: "py39"
- image: "quantum-serverless-ray-node:latest-py310"
dockerfile: "Dockerfile-ray-node"
pyversion: "py310"
- image: "quantum-repository-server:latest"
dockerfile: "./gateway/Dockerfile"
pyversion: "3.9"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Scan image ${{ matrix.image }}
uses: ./.github/actions/docker-vscan
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
dockerfile: ${{ matrix.dockerfile }}
docker_image_name: ${{ matrix.image }}
pyversion: ${{ matrix.pyversion }}