-
Notifications
You must be signed in to change notification settings - Fork 43
82 lines (67 loc) · 2.1 KB
/
security-checks.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
name: Security checks
on:
workflow_call:
secrets:
MONDOO_SECRET:
required: true
jobs:
build-api:
name: Build and scan api container image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
uses: docker/build-push-action@v5
env:
NODE_ENV: production
with:
push: false
target: production
tags: ghcr.io/podkrepi-bg/api:pr
- name: Scan with Mondoo
uses: mondoohq/actions/docker-image@main
env:
MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }}
with:
image: ghcr.io/podkrepi-bg/api:pr
build-maintenance:
name: Build and scan migrations container image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
uses: docker/build-push-action@v5
with:
push: false
file: Dockerfile.migrations
target: base
tags: ghcr.io/podkrepi-bg/api/migrations:pr
- name: Scan with Mondoo
uses: mondoohq/actions/docker-image@main
env:
MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }}
with:
image: ghcr.io/podkrepi-bg/api/migrations:pr
scan-manifests:
name: Scan k8s manifests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install kustomize
uses: imranismail/setup-kustomize@v2
- name: Build development manifests
run: kustomize build manifests/overlays/development > dev-manifests.yaml
- name: Scan development manifests with Mondoo
uses: mondoohq/actions/k8s-manifest@main
env:
MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }}
with:
path: dev-manifests.yaml
- name: Build production manifests
run: kustomize build manifests/overlays/production > prod-manifests.yaml
- name: Scan production manifests with Mondoo
uses: mondoohq/actions/k8s-manifest@main
env:
MONDOO_CONFIG_BASE64: ${{ secrets.MONDOO_SECRET }}
with:
path: prod-manifests.yaml