Skip to content

Commit

Permalink
feat: disable allowPrivilegeEscalation
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatur committed Jul 13, 2023
1 parent 54fd8aa commit 9443225
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions traefik/tests/pod-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ tests:
podSecurityContext:
readOnlyRootFilesystem: false
securityContext:
allowPrivilegeEscalation: true
runAsUser: 1000
asserts:
- equal:
Expand All @@ -39,6 +40,9 @@ tests:
- equal:
path: spec.template.spec.securityContext.runAsNonRoot
value: true
- equal:
path: spec.template.spec.containers[0].securityContext.allowPrivilegeEscalation
value: true
- equal:
path: spec.template.spec.containers[0].securityContext.runAsUser
value: 1000
Expand Down
13 changes: 7 additions & 6 deletions traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -563,15 +563,15 @@ ports:
# NodePort.
#
# -- You SHOULD NOT expose the traefik port on production deployments.
# If you want to access it from outside of your cluster,
# If you want to access it from outside your cluster,
# use `kubectl port-forward` or create a secure ingress
expose: false
# -- The exposed port for this service
exposedPort: 9000
# -- The port protocol (TCP/UDP)
protocol: TCP
web:
## -- Enable this entrypoint as a default entrypoint. When a service doesn't explicity set an entrypoint it will only use this entrypoint.
## -- Enable this entrypoint as a default entrypoint. When a service doesn't explicitly set an entrypoint it will only use this entrypoint.
# asDefault: true
port: 8000
# hostPort: 8000
Expand Down Expand Up @@ -600,7 +600,7 @@ ports:
# trustedIPs: []
# insecure: false
websecure:
## -- Enable this entrypoint as a default entrypoint. When a service doesn't explicity set an entrypoint it will only use this entrypoint.
## -- Enable this entrypoint as a default entrypoint. When a service doesn't explicitly set an entrypoint it will only use this entrypoint.
# asDefault: true
port: 8443
# hostPort: 8443
Expand Down Expand Up @@ -666,7 +666,7 @@ ports:
# NodePort.
#
# -- You may not want to expose the metrics port on production deployments.
# If you want to access it from outside of your cluster,
# If you want to access it from outside your cluster,
# use `kubectl port-forward` or create a secure ingress
expose: false
# -- The exposed port for this service
Expand Down Expand Up @@ -880,14 +880,15 @@ topologySpreadConstraints: []
priorityClassName: ""

# -- Set the container security context
# -- To run the container with ports below 1024 this will need to be adjust to run as root
# -- To run the container with ports below 1024 this will need to be adjusted to run as root
securityContext:
capabilities:
drop: [ALL]
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false

podSecurityContext:
# /!\ When setting fsGroup, Kubernetes will recursively changes ownership and
# /!\ When setting fsGroup, Kubernetes will recursively change ownership and
# permissions for the contents of each volume to match the fsGroup. This can
# be an issue when storing sensitive content like TLS Certificates /!\
# fsGroup: 65532
Expand Down

0 comments on commit 9443225

Please sign in to comment.