Repository navigation
fix(helm): run eUPF as a non-root user by default - #674
Conversation
30a6f3c to
9b52e3b
Compare
The image carries the capabilities eUPF needs as file capabilities, so the chart's default security context now runs the container as uid 1000 with NET_ADMIN, SYS_RESOURCE, BPF, PERFMON and DAC_OVERRIDE, and no SYS_ADMIN: a non-root entrypoint mounts nothing, and the kernels the chart supports have CAP_BPF. Only the node's bpffs is mounted into the pod, at /sys/fs/bpf, instead of all of /sys. Needs an appVersion whose image has the file capabilities, and bpffs mounted on the nodes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Martin Matyas <martin.matyas@tieto.com>
9b52e3b to
99307b0
Compare
|
@pirog-spb thanks for merging. One thing before anyone installs the chart from The fix is a release: an image tagged from |
For #671, the second step. Draft on purpose: it depends on an image release that carries the file capabilities of #672. With today's
appVersion0.7.1 image this change would make every install fail at exec (the binary has no file capabilities, so uid 1000 gets none). It's ready to go once:appVersionis bumped to that release (one more line in this PR when the version is known).Stacked on #672, so the diff shows both commits until #672 merges; the change of this PR is the second commit.
Change
securityContext:runAsUser: 1000,runAsGroup: 1000,runAsNonRoot: true,capabilities.add: [NET_ADMIN, SYS_RESOURCE, BPF, PERFMON, DAC_OVERRIDE]. NoSYS_ADMIN: a non-root entrypoint mounts nothing, and the kernels the chart supports haveCAP_BPF. Less privilege than today's root with the current set./systo/sys/fs/bpf: the node's bpffs is all a non-root eUPF needs. The node must have bpffs mounted there (systemd hosts do; the README covers kind).Verification
On a fork, the 0.7.1 source built with #672's Dockerfile and entrypoint, installed with exactly these defaults on a kind cluster with bpffs bound into the nodes, the CNTi suite's 19 essential tests (run 38950181467): eUPF runs as uid 1000 with exactly the five effective capabilities (
CapEff 000000c001001002), attaches XDP, andnon_root_containerspasses: 16 of 19.🤖 Generated with Claude Code