Skip to content

Commit

Permalink
feat(security)!: ✨ 🔒️ capabilities are droppped by default and can be…
Browse files Browse the repository at this point in the history
… set if needed
  • Loading branch information
mloiseleur authored May 31, 2024
1 parent ddf9e87 commit 079dec2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
5 changes: 1 addition & 4 deletions traefikee/templates/proxy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,7 @@ spec:
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
add:
- NET_BIND_SERVICE
{{- toYaml $proxy.securityContext.capabilities | nindent 14 }}
ports:
- containerPort: 8484
name: distributed
Expand Down
10 changes: 2 additions & 8 deletions traefikee/templates/stateful-sets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,7 @@ spec:
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
add:
- NET_BIND_SERVICE
{{- toYaml .Values.registry.securityContext.capabilities | nindent 14 }}
ports:
- containerPort: 6443
name: https
Expand Down Expand Up @@ -358,10 +355,7 @@ spec:
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
add:
- NET_BIND_SERVICE
{{- toYaml .Values.controller.securityContext.capabilities | nindent 14 }}
ports:
- containerPort: 4242
name: control-port
Expand Down
2 changes: 0 additions & 2 deletions traefikee/tests/controller_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ tests:
type: "RuntimeDefault"
capabilities:
drop: ["ALL"]
add: ["NET_BIND_SERVICE"]
- documentIndex: 2
equal:
path: spec.template.spec.containers[0].securityContext
Expand All @@ -263,7 +262,6 @@ tests:
type: "RuntimeDefault"
capabilities:
drop: ["ALL"]
add: ["NET_BIND_SERVICE"]

- it: should deploy only the controller when registry is disabled
set:
Expand Down
2 changes: 2 additions & 0 deletions traefikee/values-dual-proxies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ additionalProxies:
periodSeconds: 5
securityContext:
runAsUser: 65532
capabilities:
drop: ["ALL"]

# serviceLabels:
# foo: bar
Expand Down
15 changes: 14 additions & 1 deletion traefikee/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ registry:
values:
- registry
topologyKey: "kubernetes.io/hostname"

securityContext:
capabilities:
drop: ["ALL"]

# serviceLabels:
# foo: bar
# serviceAnnotations:
Expand Down Expand Up @@ -107,6 +112,11 @@ controller:
values:
- controllers
topologyKey: "kubernetes.io/hostname"

securityContext:
capabilities:
drop: ["ALL"]

# Static Configuration can be set within values OR
# from an external ConfigMap. Not both.
staticConfig:
Expand Down Expand Up @@ -209,6 +219,7 @@ proxy:
loadBalancerIP:
loadBalancerSourceRanges:


# To disable affinity at all set this value to null
affinity:
nodeAffinity:
Expand Down Expand Up @@ -272,6 +283,8 @@ proxy:
periodSeconds: 5
securityContext:
runAsUser: 65532
capabilities:
drop: ["ALL"]

# serviceLabels:
# foo: bar
Expand Down Expand Up @@ -381,5 +394,5 @@ mesh:
volumeClaimTemplates:
storageClassName:

# set it to true if CSI driver don't allow it (e.g EFS)
# Set it to true if your CSI driver don't allow (or need) it (e.g EFS)
disableChown: false

0 comments on commit 079dec2

Please sign in to comment.