Run CoreDNS container only with CAP_NET_BIND_SERVICE, drop all other (root) privileges.

Run filesystem of container and config in read-only mode.
parent d373eaa4
...@@ -118,6 +118,7 @@ spec: ...@@ -118,6 +118,7 @@ spec:
volumeMounts: volumeMounts:
- name: config-volume - name: config-volume
mountPath: /etc/coredns mountPath: /etc/coredns
readOnly: true
ports: ports:
- containerPort: 53 - containerPort: 53
name: dns name: dns
...@@ -137,6 +138,14 @@ spec: ...@@ -137,6 +138,14 @@ spec:
timeoutSeconds: 5 timeoutSeconds: 5
successThreshold: 1 successThreshold: 1
failureThreshold: 5 failureThreshold: 5
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- NET_BIND_SERVICE
drop:
- all
readOnlyRootFilesystem: true
dnsPolicy: Default dnsPolicy: Default
volumes: volumes:
- name: config-volume - name: config-volume
......
...@@ -118,6 +118,7 @@ spec: ...@@ -118,6 +118,7 @@ spec:
volumeMounts: volumeMounts:
- name: config-volume - name: config-volume
mountPath: /etc/coredns mountPath: /etc/coredns
readOnly: true
ports: ports:
- containerPort: 53 - containerPort: 53
name: dns name: dns
...@@ -137,6 +138,14 @@ spec: ...@@ -137,6 +138,14 @@ spec:
timeoutSeconds: 5 timeoutSeconds: 5
successThreshold: 1 successThreshold: 1
failureThreshold: 5 failureThreshold: 5
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- NET_BIND_SERVICE
drop:
- all
readOnlyRootFilesystem: true
dnsPolicy: Default dnsPolicy: Default
volumes: volumes:
- name: config-volume - name: config-volume
......
...@@ -118,6 +118,7 @@ spec: ...@@ -118,6 +118,7 @@ spec:
volumeMounts: volumeMounts:
- name: config-volume - name: config-volume
mountPath: /etc/coredns mountPath: /etc/coredns
readOnly: true
ports: ports:
- containerPort: 53 - containerPort: 53
name: dns name: dns
...@@ -137,6 +138,14 @@ spec: ...@@ -137,6 +138,14 @@ spec:
timeoutSeconds: 5 timeoutSeconds: 5
successThreshold: 1 successThreshold: 1
failureThreshold: 5 failureThreshold: 5
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- NET_BIND_SERVICE
drop:
- all
readOnlyRootFilesystem: true
dnsPolicy: Default dnsPolicy: Default
volumes: volumes:
- name: config-volume - name: config-volume
......
...@@ -259,6 +259,7 @@ spec: ...@@ -259,6 +259,7 @@ spec:
volumeMounts: volumeMounts:
- name: config-volume - name: config-volume
mountPath: /etc/coredns mountPath: /etc/coredns
readOnly: true
ports: ports:
- containerPort: 53 - containerPort: 53
name: dns name: dns
...@@ -278,6 +279,14 @@ spec: ...@@ -278,6 +279,14 @@ spec:
timeoutSeconds: 5 timeoutSeconds: 5
successThreshold: 1 successThreshold: 1
failureThreshold: 5 failureThreshold: 5
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- NET_BIND_SERVICE
drop:
- all
readOnlyRootFilesystem: true
dnsPolicy: Default dnsPolicy: Default
volumes: volumes:
- name: config-volume - name: config-volume
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment