shannot icon indicating copy to clipboard operation
shannot copied to clipboard

Leverage xdg-dbus-proxy for systemctl restrictions

Open corv89 opened this issue 1 year ago • 0 comments

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.

corv89 avatar Oct 24 '25 16:10 corv89