Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/render/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,12 @@ func (c *nodeComponent) nodeVolumeMounts() []corev1.VolumeMount {
// Read-only so Felix can detect kernel lockdown=confidentiality via
// /sys/kernel/security/lockdown (securityfs is separate from /sys/fs).
corev1.VolumeMount{MountPath: "/sys/kernel/security", Name: "sys-kernel-security", ReadOnly: true},
// Read-only bind of the host's /proc. Felix reaches host-mount-namespace
// paths (pod netns files, the CRI socket) through host PID-1's root at
// /host/proc/1/root, which works regardless of calico-node's PID
// namespace and does not require hostPID=true. Reuses the "nodeproc"
// HostPath(/proc) volume already declared in nodeVolumes().
corev1.VolumeMount{MountPath: "/host/proc", Name: "nodeproc", ReadOnly: true},
c.cfg.TLS.NodeSecret.VolumeMount(c.SupportedOSType()),
)

Expand Down
6 changes: 6 additions & 0 deletions pkg/render/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ var _ = Describe("Node rendering tests", func() {
{MountPath: "/var/log/calico/cni", Name: "cni-log-dir", ReadOnly: false},
{MountPath: "/sys/fs/bpf", Name: "bpffs"},
{MountPath: "/sys/kernel/security", Name: "sys-kernel-security", ReadOnly: true},
{MountPath: "/host/proc", Name: "nodeproc", ReadOnly: true},
}
Expect(ds.Spec.Template.Spec.Containers[0].VolumeMounts).To(ConsistOf(expectedNodeVolumeMounts))

Expand Down Expand Up @@ -558,6 +559,7 @@ var _ = Describe("Node rendering tests", func() {
{MountPath: "/var/log/calico/cni", Name: "cni-log-dir", ReadOnly: false},
{MountPath: "/sys/fs/bpf", Name: "bpffs"},
{MountPath: "/sys/kernel/security", Name: "sys-kernel-security", ReadOnly: true},
{MountPath: "/host/proc", Name: "nodeproc", ReadOnly: true},
}
Expect(ds.Spec.Template.Spec.Containers[0].VolumeMounts).To(ConsistOf(expectedNodeVolumeMounts))

Expand Down Expand Up @@ -988,6 +990,7 @@ var _ = Describe("Node rendering tests", func() {
{MountPath: "/var/log/calico/cni", Name: "cni-log-dir", ReadOnly: false},
{MountPath: "/sys/fs/bpf", Name: "bpffs"},
{MountPath: "/sys/kernel/security", Name: "sys-kernel-security", ReadOnly: true},
{MountPath: "/host/proc", Name: "nodeproc", ReadOnly: true},
}
Expect(ds.Spec.Template.Spec.Containers[0].VolumeMounts).To(ConsistOf(expectedNodeVolumeMounts))

Expand Down Expand Up @@ -1125,6 +1128,7 @@ var _ = Describe("Node rendering tests", func() {
{MountPath: "/node-certs", Name: render.NodeTLSSecretName, ReadOnly: true},
{MountPath: "/sys/fs/bpf", Name: "bpffs"},
{MountPath: "/sys/kernel/security", Name: "sys-kernel-security", ReadOnly: true},
{MountPath: "/host/proc", Name: "nodeproc", ReadOnly: true},
}
Expect(ds.Spec.Template.Spec.Containers[0].VolumeMounts).To(ConsistOf(expectedNodeVolumeMounts))

Expand Down Expand Up @@ -1396,6 +1400,7 @@ var _ = Describe("Node rendering tests", func() {
{MountPath: "/var/log/calico/cni", Name: "cni-log-dir", ReadOnly: false},
{MountPath: "/sys/fs/bpf", Name: "bpffs"},
{MountPath: "/sys/kernel/security", Name: "sys-kernel-security", ReadOnly: true},
{MountPath: "/host/proc", Name: "nodeproc", ReadOnly: true},
}
Expect(ds.Spec.Template.Spec.Containers[0].VolumeMounts).To(ConsistOf(expectedNodeVolumeMounts))

Expand Down Expand Up @@ -1530,6 +1535,7 @@ var _ = Describe("Node rendering tests", func() {
{MountPath: "/node-certs", Name: render.NodeTLSSecretName, ReadOnly: true},
{MountPath: "/sys/fs/bpf", Name: "bpffs"},
{MountPath: "/sys/kernel/security", Name: "sys-kernel-security", ReadOnly: true},
{MountPath: "/host/proc", Name: "nodeproc", ReadOnly: true},
}
Expect(ds.Spec.Template.Spec.Containers[0].VolumeMounts).To(ConsistOf(expectedNodeVolumeMounts))

Expand Down
Loading