Skip to content

fix(controlplane): let the control plane's pods ping without sudo - #960

Merged
mxsrc merged 2 commits into
mainfrom
sudoless-ping
Nov 23, 2026
Merged

mxsrc merged 2 commits into
mainfrom
sudoless-ping

Conversation

@mxsrc

@mxsrc mxsrc commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The control plane currently invokes ping via sudo. This is because:

  • UBI images don't ship ping with setuid, which would be common on classical distributions
  • The restricted security context prevents any setuid bit from taking effect.

This changeset is meant to address #946 while requiring fewer privileges.

Sets net.ipv4.ping_group_range=0 2147483647 in the pod security context of the four Deployments that run the control plane image (webappapi, tasks, monitoring, admin-control). Any group can then open ICMP and ICMPv6 echo sockets, so the storage node monitor can ping without sudo, setuid, or CAP_NET_RAW. Despite its name, the sysctl also covers IPv6.

The sysctl is network-namespaced and on the kubelet's safe list since 1.18. Pod Security baseline/restricted and OpenShift's SCCs admit it. None of these pods use the host network.

Companion: simplyblock/sbcli#1702 drops sudo from ping_host. This PR is harmless with the current image and should merge first.

Follow-up: reverting #954

Once the minimum control plane image the operator deploys contains the sbcli change, #954 (anyuid SCC) can be reverted, with these conditions:

  • ping_host is the only sudo call reachable in these pods on Kubernetes. The others are Docker swarm, systemd, or storage node paths.
  • The revert must also delete the simplyblock-scc-anyuid RoleBinding. It is owned by the ControlPlane, so it is not garbage-collected when the operator stops applying it.
  • The image must otherwise run under a random UID (home directory, written files). That needs an OpenShift run under restricted-v2.

Testing

  • TestEveryControlPlaneImageWorkloadMayPingUnprivileged, red before the change, green after. make test passes.
  • UBI10 container as UID 5000: ping -4 and ping -6 fail by default and succeed with the sysctl set.

Set net.ipv4.ping_group_range to "0 2147483647" on every pod that runs
the control plane image (webappapi, tasks, monitoring, admin-control).
Any group may then open ICMP and ICMPv6 echo sockets, so the storage node
monitor can ping without sudo or CAP_NET_RAW once the image drops sudo.
The sysctl is namespaced and on the kubelet's safe list.
@mxsrc
mxsrc requested a review from boddumanohar November 23, 2026 11:36
@mxsrc
mxsrc merged commit 0c7340b into main Nov 23, 2026
24 checks passed
@mxsrc
mxsrc deleted the sudoless-ping branch November 23, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants