Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7ee5729e
Unverified
Commit
7ee5729e
authored
May 29, 2018
by
Nico Berlee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
0 deletions
+36
-0
coredns.yaml.base
cluster/addons/dns/coredns/coredns.yaml.base
+9
-0
coredns.yaml.in
cluster/addons/dns/coredns/coredns.yaml.in
+9
-0
coredns.yaml.sed
cluster/addons/dns/coredns/coredns.yaml.sed
+9
-0
manifests.go
cmd/kubeadm/app/phases/addons/dns/manifests.go
+9
-0
No files found.
cluster/addons/dns/coredns/coredns.yaml.base
View file @
7ee5729e
...
@@ -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
...
...
cluster/addons/dns/coredns/coredns.yaml.in
View file @
7ee5729e
...
@@ -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
...
...
cluster/addons/dns/coredns/coredns.yaml.sed
View file @
7ee5729e
...
@@ -118,6 +118,7 @@ spec:
...
@@ -118,6 +118,7 @@ spec:
volumeMounts
:
volumeMounts
:
-
na
me: config-volume
-
na
me: config-volume
mou
n
t
Pa
th: /etc/coredns
mou
n
t
Pa
th: /etc/coredns
re
a
dOnly: true
p
ort
s
:
p
ort
s
:
- containerPort
:
53
- containerPort
:
53
name
:
dns
name
:
dns
...
@@ -137,6 +138,14 @@ spec:
...
@@ -137,6 +138,14 @@ spec:
timeoutSe
c
o
nds
:
5
timeoutSe
c
o
nds
:
5
successThreshold
:
1
successThreshold
:
1
failureThreshold
:
5
failureThreshold
:
5
s
e
curityCont
e
xt:
allowPrivil
e
g
eE
s
c
alation: false
c
apabilities:
add:
- NET_BIND_SERVICE
drop:
- all
readOnlyRootFilesystem: true
dnsPoli
c
y
:
Default
dnsPoli
c
y
:
Default
volumes
:
volumes
:
- name
:
c
onfig-volume
- name
:
c
onfig-volume
...
...
cmd/kubeadm/app/phases/addons/dns/manifests.go
View file @
7ee5729e
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment