Merge pull request #911 from bogdando/DROP_CAPS

Drop linux capabilities and rework users/groups
This commit is contained in:
Bogdan Dobrelya
2017-02-06 12:05:51 +01:00
committed by GitHub
48 changed files with 413 additions and 81 deletions

View File

@@ -51,3 +51,18 @@ netchecker_kubectl_memory_requests: 64M
etcd_cert_dir: "/etc/ssl/etcd/ssl"
calico_cert_dir: "/etc/calico/certs"
canal_cert_dir: "/etc/canal/certs"
# Linux capabilities to be dropped for k8s apps ran by container engines
apps_drop_cap:
- chown
- dac_override
- fowner
- fsetid
- kill
- setgid
- setuid
- setpcap
- sys_chroot
- mknod
- audit_write
- setfcap

View File

@@ -25,6 +25,12 @@ spec:
- name: calico-policy-controller
image: {{ calico_policy_image_repo }}:{{ calico_policy_image_tag }}
imagePullPolicy: {{ k8s_image_pull_policy }}
securityContext:
capabilities:
drop:
{% for c in apps_drop_cap %}
- {{ c.upper() }}
{% endfor %}
resources:
limits:
cpu: {{ calico_policy_controller_cpu_limit }}

View File

@@ -23,6 +23,12 @@ spec:
- name: REPORT_INTERVAL
value: '{{ agent_report_interval }}'
imagePullPolicy: {{ k8s_image_pull_policy }}
securityContext:
capabilities:
drop:
{% for c in apps_drop_cap %}
- {{ c.upper() }}
{% endfor %}
resources:
limits:
cpu: {{ netchecker_agent_cpu_limit }}

View File

@@ -24,6 +24,12 @@ spec:
- name: REPORT_INTERVAL
value: '{{ agent_report_interval }}'
imagePullPolicy: {{ k8s_image_pull_policy }}
securityContext:
capabilities:
drop:
{% for c in apps_drop_cap %}
- {{ c.upper() }}
{% endfor %}
resources:
limits:
cpu: {{ netchecker_agent_cpu_limit }}

View File

@@ -33,3 +33,9 @@ spec:
memory: {{ netchecker_kubectl_memory_requests }}
args:
- proxy
securityContext:
capabilities:
drop:
{% for c in apps_drop_cap %}
- {{ c.upper() }}
{% endfor %}