Hi,
When running as non-root, the capability is set correctly in the
bounding set but not in the effective set, so it is too restrictive in
practice:
$ sudo rkt run --insecure-options=image --interactive docker://ubuntu
--caps-retain=CAP_NET_BIND_SERVICE --exec=/bin/sh -- -c 'capsh
--print'
Current: = cap_net_bind_service+ep
Bounding set =cap_net_bind_service
$ sudo rkt run --insecure-options=image --interactive docker://ubuntu
--user=1000 --group=1000 --caps-retain=CAP_NET_BIND_SERVICE
--exec=/bin/sh -- -c 'capsh --print'
Current: =
Bounding set =cap_net_bind_service
rkt uses the systemd's option "CapabilityBoundingSet" to set the capability:
https://www.freedesktop.org/software/systemd/man/systemd.exec.html#CapabilityBoundingSet=
It does not use the option "AmbientCapabilities" (the doc says it is
"useful if you want to execute a process as a non-privileged user but
still want to give it some capabilities"):
https://www.freedesktop.org/software/systemd/man/systemd.exec.html#AmbientCapabilities=
Maybe we should add the option "AmbientCapabilities". Could you file
an issue on github to discuss this?
Cheers,
Alban