-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (75 loc) · 2.37 KB
/
validate.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
---
name: Validate
# yamllint disable-line rule:truthy
on:
pull_request:
branches:
- "*"
push:
branches:
- main
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
strategy:
matrix:
overlay:
- examples/simple-web-service
- resources/external-secret/docker-hub
- resources/external-secret-store/aws
- resources/namespace
- resources/network/ingress
- resources/network/service
- resources/workload/cronjob
- resources/workload/daemonset
- resources/workload/deployment
- resources/workload/job
- resources/workload/pod
- resources/workload/replicaset
- resources/workload/statefulset
fail-fast: false
steps:
- name: Login to Github Packages
run: echo "${{ github.token }}" | docker login https://ghcr.io -u ${GITHUB_ACTOR} --password-stdin
- uses: actions/checkout@v3
- name: Kustomize Build
run: kustomize build ${{ matrix.overlay }} > ${{ matrix.overlay }}/rendered.yaml
- name: Run Kubeconform (Default Schemas)
uses: docker://ghcr.io/yannh/kubeconform:v0.6.1
with:
entrypoint: '/kubeconform'
args: "-strict -ignore-missing-schemas -schema-location default -summary ${{ matrix.overlay }}/rendered.yaml"
- name: Run Kubeconform (CRDs)
uses: docker://ghcr.io/yannh/kubeconform:v0.6.1
with:
entrypoint: '/kubeconform'
args: "-strict -ignore-missing-schemas -schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' -summary ${{ matrix.overlay }}/rendered.yaml"
- name: Run Checkov
uses: bridgecrewio/checkov-action@v12
with:
file: "${{ matrix.overlay }}/rendered.yaml"
framework: kubernetes
security-gha:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Checkov
uses: bridgecrewio/checkov-action@v12
with:
directory: .github
framework: github_actions
secrets-scan:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@main
with:
path: ./
base: ${{ github.event.repository.default_branch }}
head: HEAD