Skip to content

fix(helm): run eUPF as a non-root user by default - #674

Merged
pirog-spb merged 1 commit into
edgecomllc:mainfrom
martin-mat:nonroot-chart
Oct 29, 2026
Merged

pirog-spb merged 1 commit into
edgecomllc:mainfrom
martin-mat:nonroot-chart

Conversation

@martin-mat

Copy link
Copy Markdown
Contributor

For #671, the second step. Draft on purpose: it depends on an image release that carries the file capabilities of #672. With today's appVersion 0.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:

  1. feat(docker): file capabilities on the eupf binary, so it can run as a non-root user #672 is merged, and
  2. an image is released from it, and the chart's appVersion is 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]. No SYS_ADMIN: a non-root entrypoint mounts nothing, and the kernels the chart supports have CAP_BPF. Less privilege than today's root with the current set.
  • The hostPath narrows from /sys to /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, and non_root_containers passes: 16 of 19.

🤖 Generated with Claude Code

@martin-mat
martin-mat force-pushed the nonroot-chart branch 2 times, most recently from 30a6f3c to 9b52e3b Compare October 22, 2026 12:20
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>
Comment thread .deploy/helm/eupf/values.yaml
@pirog-spb
pirog-spb marked this pull request as ready for review October 29, 2026 06:27
@pirog-spb
pirog-spb merged commit e96db73 into edgecomllc:main Oct 29, 2026
8 checks passed
@martin-mat

Copy link
Copy Markdown
Contributor Author

@pirog-spb thanks for merging. One thing before anyone installs the chart from main: its appVersion is still 0.7.1, and the 0.7.1 image predates #672, so the eupf binary in it has no file capabilities. As uid 1000 it gets none of the five, and eUPF cannot load its eBPF program: the case the description of this PR warned about. Your deploy workflow sets appVersion to the commit SHA, so the dev and test deployments run a main-built image and don't show it.

The fix is a release: an image tagged from main (v0.7.2, say) carries the file capabilities, and appVersion bumped to it makes the chart's defaults start again. Until then, an install from this chart needs --set image.tag=<a main commit SHA>, the tag your build workflow publishes for each commit. If a release is further off, setting securityContext back to root would be the other stopgap.

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