Where should privileged helper scripts live on an immutable-root distro? #307
vladimirrott
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
SysKnife's daemon runs twelve privileged helper scripts. Each exists to replace a wider
sudogrant with a narrow one:grub-kargs-editreplaced unconstrainedcp,python3andupdate-grubgrants, andsysctl-editexists so no baresysctlgrant is needed, sincesysctl -p <file>would let the daemon load an attacker's file.The grants name one absolute path each:
That path is written down in three places that all have to agree: twelve
conststrings in the daemon, twelveNOPASSWDgrants, and twelve Makefile install lines.On Fedora Atomic,
/usr/libis read-only, somake installcannot put them there. It has never worked; see #301.Why each obvious answer costs something
Move them to
/usr/local/lib/sysknife. Works everywhere, no new packaging./usr/localis/var/usrlocalon ostree, root-owned, so thesysknifeuser still cannot plant a script there, and the daemon binary already installs there on ostree anyway. The cost is migrating the layout of the primary platform, Ubuntu, to accommodate the deprioritized one, across twenty-four sites, with a window where a new binary against an old sudoers file loses every helper-backed action.Move them to
/etc/sysknife/helpers. Writable on ostree, root-only, and/etcalready holds executables on Debian systems (/etc/cron.daily,/etc/network/if-up.d). Same migration cost, plus executables in a directory the FHS reserves for configuration.Ship an RPM and layer it with
rpm-ostree. Puts them at/usr/lib/sysknifeinside the ostree commit, immutable, exactly where the grants and constants already point, and Ubuntu is untouched. The cost is a spec file, a build job and a second release artifact.What I would like to hear
If you have shipped a Rust daemon with root-executed helper scripts onto Silverblue, Kinoite, or any image-based distro, what did you do with them, and what went wrong with it a year later?
Two specific things I do not know:
npx sysknife-setup, or whether it splits the install story badly enough that the path migration is the lesser evil.NOPASSWDwildcard into arbitrary root execution, but I would rather be shown a better shape than defend that list.Absent better input I will do the RPM, because it leaves the primary platform alone and works with the platform rather than around it. I would rather change my mind now than after the spec file exists.
All reactions