From 755c20f2f99508ba50059a71645d418ac71402b5 Mon Sep 17 00:00:00 2001 From: Spencer Smith Date: Mon, 1 May 2017 14:51:40 -0400 Subject: [PATCH] ensure the /etc/os-release is mounted read only --- roles/kubernetes/node/templates/kubelet-container.j2 | 2 +- roles/kubernetes/node/templates/kubelet.rkt.service.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/kubernetes/node/templates/kubelet-container.j2 b/roles/kubernetes/node/templates/kubelet-container.j2 index b5b89461a..94c7f79a5 100644 --- a/roles/kubernetes/node/templates/kubelet-container.j2 +++ b/roles/kubernetes/node/templates/kubelet-container.j2 @@ -25,7 +25,7 @@ -v /var/lib/cni:/var/lib/cni:shared \ -v /var/run:/var/run:rw \ -v {{kube_config_dir}}:{{kube_config_dir}}:ro \ - -v /etc/os-release:/etc/os-release \ + -v /etc/os-release:/etc/os-release:ro \ {{ hyperkube_image_repo }}:{{ hyperkube_image_tag}} \ ./hyperkube kubelet \ "$@" diff --git a/roles/kubernetes/node/templates/kubelet.rkt.service.j2 b/roles/kubernetes/node/templates/kubelet.rkt.service.j2 index 0b0543ea5..5f8351458 100644 --- a/roles/kubernetes/node/templates/kubelet.rkt.service.j2 +++ b/roles/kubernetes/node/templates/kubelet.rkt.service.j2 @@ -20,7 +20,7 @@ ExecStartPre=-/bin/mkdir -p /var/lib/kubelet EnvironmentFile={{kube_config_dir}}/kubelet.env # stage1-fly mounts /proc /sys /dev so no need to duplicate the mounts ExecStart=/usr/bin/rkt run \ - --volume os-release,kind=host,source=/etc/os-release \ + --volume os-release,kind=host,source=/etc/os-release,readOnly=true \ --volume dns,kind=host,source=/etc/resolv.conf \ --volume etc-kubernetes,kind=host,source={{ kube_config_dir }},readOnly=false \ --volume etc-ssl-certs,kind=host,source=/etc/ssl/certs,readOnly=true \