shannot
shannot copied to clipboard
Leverage xdg-dbus-proxy for systemctl restrictions
Add xdg-dbus-proxy support to filter allowed D-Bus methods:
xdg-dbus-proxy \
unix:path=/run/dbus/system_bus_socket \
/tmp/filtered-dbus \
--filter \
--call=org.freedesktop.systemd1.Manager.GetUnit=* \
--call=org.freedesktop.systemd1.Manager.ListUnits=* \
--call=org.freedesktop.systemd1.Unit.* &
bwrap \
--ro-bind /usr /usr \
--ro-bind /tmp/filtered-dbus /run/dbus/system_bus_socket \
--setenv DBUS_SYSTEM_BUS_ADDRESS unix:path=/run/dbus/system_bus_socket \
systemctl status
This filtering restricts access to read-only status queries while blocking dangerous write operations like starting, stopping, or reloading services.