Skip to content

Commit 035c7be

Browse files
committed
waf-simple
1 parent c1d6c3a commit 035c7be

File tree

8 files changed

+150
-0
lines changed

8 files changed

+150
-0
lines changed

charts/simple-waf/Chart.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: simple-waf
3+
description: Simple deployment of CloudGuard WAF with self signed certificate
4+
type: application
5+
version: 0.0.1
6+
appVersion: "1.0.1"

charts/simple-waf/templates/NOTES.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
Enjoy your web app running at:
3+
https://{{ .Values.hostname }}/

charts/simple-waf/templates/cert.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: cert-manager.io/v1
2+
kind: Certificate
3+
metadata:
4+
name: hello-klaud-cert
5+
namespace: default
6+
spec:
7+
secretName: hello-klaud-tls
8+
duration: 2160h # 90 days
9+
renewBefore: 360h # 15 days before expiry
10+
subject:
11+
organizations:
12+
- Klaud Online
13+
commonName: {{.Values.hostname }}
14+
dnsNames:
15+
- {{.Values.hostname }}
16+
issuerRef:
17+
name: selfsigned-cluster-issuer
18+
kind: ClusterIssuer
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: appsec
5+
spec:
6+
replicas: 2 # Adjust the number of replicas as needed
7+
selector:
8+
matchLabels:
9+
app: appsec
10+
template:
11+
metadata:
12+
labels:
13+
app: appsec
14+
spec:
15+
containers:
16+
- name: cloudguard-appsec-standalone
17+
env:
18+
- name: CPTOKEN
19+
valueFrom:
20+
secretKeyRef:
21+
name: appsec
22+
key: cptoken
23+
# securityContext:
24+
# runAsUser: 0
25+
# runAsGroup: 0
26+
image: checkpoint/cloudguard-appsec-standalone:latest
27+
#image: checkpoint/cloudguard-appsec-standalone:787396
28+
args:
29+
- /cloudguard-appsec-standalone
30+
- --token
31+
- $(CPTOKEN)
32+
- --ignore-all
33+
# env:
34+
# - name: https_proxy
35+
# value: "user:password@Proxy address:port"
36+
ports:
37+
- containerPort: 443 # SSL port
38+
- containerPort: 80 # HTTP port
39+
- containerPort: 8117 # Health-check port
40+
volumeMounts:
41+
- name: tls-secret
42+
mountPath: "/etc/certs/hello.pem"
43+
subPath: "tls.crt"
44+
readOnly: true
45+
- name: tls-secret
46+
mountPath: "/etc/certs/hello.key"
47+
subPath: "tls.key"
48+
# - name: certs
49+
# mountPath: "/etc/certs2/"
50+
imagePullPolicy: Always
51+
livenessProbe:
52+
failureThreshold: 3
53+
httpGet:
54+
path: /
55+
port: 8117
56+
scheme: HTTP
57+
periodSeconds: 20
58+
successThreshold: 1
59+
timeoutSeconds: 10
60+
startupProbe:
61+
failureThreshold: 90
62+
httpGet:
63+
path: /
64+
port: 8117
65+
scheme: HTTP
66+
periodSeconds: 10
67+
successThreshold: 1
68+
timeoutSeconds: 10
69+
terminationMessagePath: /dev/termination-log
70+
terminationMessagePolicy: File
71+
dnsPolicy: ClusterFirst
72+
restartPolicy: Always
73+
#schedulerName: default-scheduler
74+
securityContext: {}
75+
terminationGracePeriodSeconds: 30
76+
volumes:
77+
- name: tls-secret
78+
secret:
79+
secretName: hello-klaud-tls
80+
- name: certs
81+
emptyDir: {}
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: cert-manager.io/v1
2+
kind: ClusterIssuer
3+
metadata:
4+
name: selfsigned-cluster-issuer
5+
spec:
6+
selfSigned: {}
7+
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: appsec
5+
type: Opaque
6+
stringData:
7+
cptoken: {{ .Values.cptoken }}
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: appsec
6+
spec:
7+
selector:
8+
app: appsec
9+
ports:
10+
- protocol: TCP
11+
port: 443
12+
name: https
13+
targetPort: 443 # Match the containerPort of the deployed pod
14+
- protocol: TCP
15+
port: 80
16+
name: http
17+
targetPort: 80 # Match the containerPort of the deployed pod
18+
- protocol: TCP
19+
port: 8117
20+
name: health-check
21+
targetPort: 8117 # Match the containerPort of the deployed pod
22+
type: LoadBalancer

charts/simple-waf/values.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
# hostname to publish to
3+
hostname: "hello.klaud.online"
4+
# token of your Docker Single Managed profile
5+
cptoken:
6+

0 commit comments

Comments
 (0)