dinit-interchange; Secure, Polkit-free service control over D-Bus #580
Timh1970
started this conversation in
Show and tell
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.
I wanted to share a project I've been working on called dinit-interchange. It acts as a lightweight, secure bridge between dinit and D-Bus, designed specifically with Artix Linux setups in mind.
🚀 Why build it?
In a desktop or application server environment, unprivileged users or applications often need to manage specific system/user services. Normally, you would have to grant broad, risky administrative rights via sudo, write un-auditable SUID wrappers, or deploy the massive, complex framework that is Polkit.
Upstream dinit strictly protects its control pipe socket against non-root users. dinit-interchange solves this by acting as a minimal, audit-friendly gateway that handles secure privilege delegation using lightweight JSON configuration rules on a per-service basis.
✨ Key Features
📁 Granular Rule Example
To let an unprivileged user or web process like www-data manage xvfb without sudo elevations, you simply drop this into /etc/dinit-interchange/rules.d/xvfb.policy:
{ "users": { "www-data": [ "start", "status" ] } }💡 The Real-World "Accidental" Use Case
This project was born out of a practical necessity on an application server deploying the HTML-to-PDF library wkgtk-html2pdf. The restricted web server user (www-data) needed to conditionally verify and launch a virtual frame buffer (Xvfb) so WebKitGTK wouldn't crash. dinit-interchange allows this automated pipeline to safely boot its own dependencies without introducing Remote Code Execution (RCE) root-escalation vulnerabilities to the host. The practical implementation is here https://github.com/Timh1970/wkgtk-html2pdf/blob/main/src/wk2gtkpdf/ichtmltopdf_int.cpp
🛠️ Check it Out
The project depends on libdinitctl and includes a built-in C++/GDBus reference utility tool called dinit-taxi to easily test IPC queries from the command line.
I would love to hear your thoughts, feedback, or any edge cases you run into!
All reactions