Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit d5a5048

Browse files
committed
🔒️ Hardening - reduce OpenVPN preconfiguration and runtime privilege (Linux capabilities)
1 parent 7f496d7 commit d5a5048

File tree

6 files changed

+3
-49
lines changed

6 files changed

+3
-49
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ Access the components that you've enabled in the Helm values (after authenticati
374374
* code.YOUR_DOMAIN for Code Server IDE
375375
* code-dev-server.YOUR_DOMAIN for a development web server
376376
* e.g. `hugo serve -D --bind=0.0.0.0 --baseUrl=hugo.YOUR_DOMAIN --appendPort=false` in Code Server
377-
* pgweb.YOUR_DOMAIN for Pgweb (for VPN initialization, `kubectl exec` and then `openvpn --config /etc/client.ovpn`)
377+
* pgweb.YOUR_DOMAIN for Pgweb
378378
* selenium-hub.YOUR_DOMAIN for Selenium Grid hub
379379
* selenium-chrome.YOUR_DOMAIN for Selenium node (Chrome)
380380
* selenium-firefox.YOUR_DOMAIN for Selenium node (Firefox)

deploy/templates/code.yaml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ spec:
6464
- name: PASSWORD
6565
value: "{{ .Values.authentication.password }}"
6666
securityContext:
67-
privileged: true
67+
capabilities:
68+
add: ["NET_ADMIN"]
6869
resources: {{ toYaml .Values.code.resources | nindent 10 }}
6970
volumeMounts:
7071
- name: coder
@@ -73,11 +74,6 @@ spec:
7374
- name: coder-profile
7475
mountPath: /home/coder/.profile
7576
subPath: .profile
76-
{{ if eq .Values.code.ovpn true }}
77-
- name: client-ovpn
78-
mountPath: /etc/client.ovpn
79-
subPath: client.ovpn
80-
{{ end }}
8177
- name: dind-daemon
8278
image: {{ .Values.code.dind.image }}
8379
env:
@@ -101,12 +97,6 @@ spec:
10197
configMap:
10298
name: coder-profile-v1
10399
defaultMode: 0644
104-
{{ if eq .Values.code.ovpn true }}
105-
- name: client-ovpn
106-
secret:
107-
secretName: client-ovpn
108-
defaultMode: 0400
109-
{{ end }}
110100
{{ if eq .Values.policies.enabled true }}
111101
---
112102
apiVersion: networking.k8s.io/v1

deploy/templates/jupyter.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,15 @@ spec:
4141
- name: GRANT_SUDO
4242
value: "yes"
4343
securityContext:
44-
privileged: true
4544
runAsUser: 0
4645
resources: {{ toYaml .Values.jupyter.resources | nindent 10 }}
4746
volumeMounts:
4847
- name: jupyter
4948
mountPath: /home/jovyan/work
50-
{{ if eq .Values.jupyter.ovpn true }}
51-
- name: client-ovpn
52-
mountPath: /etc/client.ovpn
53-
subPath: client.ovpn
54-
{{ end }}
5549
volumes:
5650
- name: jupyter
5751
persistentVolumeClaim:
5852
claimName: jupyter-pvc
59-
{{ if eq .Values.jupyter.ovpn true }}
60-
- name: client-ovpn
61-
secret:
62-
secretName: client-ovpn
63-
defaultMode: 0400
64-
{{ end }}
6553
{{ if eq .Values.policies.enabled true }}
6654
---
6755
apiVersion: networking.k8s.io/v1

deploy/templates/pgweb.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,7 @@ spec:
3434
containers:
3535
- name: pgweb
3636
image: {{ .Values.pgweb.image }}
37-
securityContext:
38-
privileged: true
3937
resources: {{ toYaml .Values.pgweb.resources | nindent 10 }}
40-
{{ if eq .Values.pgweb.ovpn true }}
41-
volumeMounts:
42-
- name: client-ovpn
43-
mountPath: /etc/client.ovpn
44-
subPath: client.ovpn
45-
volumes:
46-
- name: client-ovpn
47-
secret:
48-
secretName: client-ovpn
49-
defaultMode: 0400
50-
{{ end }}
5138
{{ if eq .Values.policies.enabled true }}
5239
---
5340
apiVersion: networking.k8s.io/v1

deploy/templates/sftp.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ spec:
3737
- name: sftp
3838
image: {{ .Values.sftp.image }}
3939
args: ["{{ .Values.authentication.username }}:{{ .Values.authentication.password }}:1001:100"]
40-
securityContext:
41-
privileged: true
4240
resources: {{ toYaml .Values.sftp.resources | nindent 10 }}
4341
volumeMounts:
4442
- name: sftp

deploy/values.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ oauth2Proxy:
5555
code:
5656
enabled: true
5757
image: ndebuhr/cloud-native-workstation-code-server:v0.13.1
58-
# For accessing cloud resources over VPN, set ovpn=true and:
59-
# kubectl create secret generic client-ovpn --from-file=client.ovpn
60-
ovpn: false
6158
storage: 32Gi
6259
resources: {}
6360
dind:
@@ -69,9 +66,6 @@ code:
6966
pgweb:
7067
enabled: false
7168
image: ndebuhr/cloud-native-workstation-pgweb:v0.13.1
72-
# For accessing databases over VPN, set ovpn=true and:
73-
# kubectl create secret generic client-ovpn --from-file=client.ovpn
74-
ovpn: false
7569
resources: {}
7670

7771
# SFTP server
@@ -104,9 +98,6 @@ selenium:
10498
jupyter:
10599
enabled: false
106100
image: ndebuhr/cloud-native-workstation-jupyter:v0.13.1
107-
# For accessing cloud resources over VPN, set ovpn=true and:
108-
# kubectl create secret generic client-ovpn --from-file=client.ovpn
109-
ovpn: false
110101
storage: 32Gi
111102
gpu:
112103
enabled: false

0 commit comments

Comments
 (0)