Products › lamco-dbus-tools › Interfaces

D-Bus policy files: busconfig, policy, and which rule decided

D-Bus policy files in /usr/share/dbus-1/system.d decide who may call and own what on the system bus, and lamco-dbus-tools names the rule that decided.

Configuration /usr/share/dbus-1/system.d, busconfig, policy

D-Bus policy files are the XML files, rooted at <busconfig>, that tell a bus who may send what to whom and who may own which name. On the system bus they're the main thing standing between an ordinary user and a service running as root. Every package with a system service installs one in /usr/share/dbus-1/system.d. When a call fails with "access denied", one of these rules decided, and the error doesn't say which. lamco-dbus-tools reads the files as each bus implementation reads them, says which rule decided a given call, and holds its answers to the real daemons.

What it is

The system bus reads /usr/share/dbus-1/system.conf, which includes the files in /usr/share/dbus-1/system.d for packages and /etc/dbus-1/system.d for the administrator. Inside, <policy> blocks hold <allow> and <deny> rules. A block has one of four attributes: context="default" or "mandatory", user=, group=, or at_console=. A rule's attributes include:

  • send_destination, send_destination_prefix, send_interface, send_member, send_path, send_type and send_error, with matching receive_* forms.
  • own and own_prefix, for taking names.
  • eavesdrop, send_requested_reply, min_fds and max_fds.

Blocks apply in the order the dbus-daemon man page gives: Default, then the connection's groups, then its user, then at_console, then mandatory. The last rule that matches decides, and the system bus denies by default. A rule with several attributes matches only when all of them do. A send_destination matches whoever owns that name, not the text in the message.

The exceptions are where trouble starts, and the repository's evaluator records each:

  • dbus-daemon applies a deny by interface to a call that names no interface. dbus-broker doesn't.
  • dbus-broker drops send_destination_prefix, send_error, receive_error and log from a rule, which then applies without them, and drops rules on method_return and error.
  • An exact own grants the names below it on dbus-broker.
  • A block for a user or group the machine lacks is dropped whole on both, its denials with it.
  • A rule that names only an error allows an ordinary call on both.
  • <includedir> order is as the directory lists it on dbus-daemon, and sorted on dbus-broker.

Errors you'll meet

  • org.freedesktop.DBus.Error.AccessDenied: A rule refused the call or the name. On dbus-daemon the text leads with "Rejected send message, 1 matched rules", as recorded: Error: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 1 matched rules; type="method_call", sender=":1.123" (uid=1000 pid=2095 comm="gdbus call --system --dest com.example.Backup --ob") interface="com.example.Backup" member="Start" error name="(unset)" requested_reply="0". The sender, pid and uid vary. dbus-broker logs a denial as "A security policy denied".

How lamco-dbus-tools reads it

dbussee audit collect reads the configuration as dbus-daemon and as dbus-broker read it, each with its include order and the rules it drops or widens, and keeps every rule's file and line. dbusdo policy probe gives a file to each real daemon on a private bus, sends call and own probes, and holds every answer to the evaluator. dbustell policy says whether a user may send a call or own a name on each implementation, naming the last rule that matched or the default deny. dbustell audit gives the POL- findings, and with --baseline what changed.

dbussee audit collect --out audit.json                      # every policy file, as each bus reads it
dbusdo policy probe --base system --probes probes.txt /usr/share/dbus-1/system.d/org.freedesktop.hostname1.conf   # both real daemons
dbustell policy audit.json --user alice --call com.example.Backup com.example.Backup Start   # the verdict and the rule
dbustell audit audit.json --baseline last-month.json        # POL- findings, and what's new since the baseline

Where it has been run

The README's run record lists the policy audit of a whole machine on Debian 13 and Fedora 45, the per-name table of 56 and 76 names read from files, and one policy file changed on purpose giving one new finding of 79, on 2026-11-30. The evaluator's eleven cases agree with dbus-daemon 1.16.2, dbus-broker 37 and Fedora's dbus-broker 37-9, on Debian 13 and Fedora 45, on 2026-11-30. A refusal joined to dbus-daemon's log line was run on private buses on 2026-11-29 and 2026-11-30.

Findings

  • POL-001: An allow with no destination opens an interface to every service.
  • POL-002: Every user may send to every name on the system bus.
  • POL-003: Every user may own a name on the system bus.
  • POL-004: A policy file reads differently on the two bus implementations.
  • POL-005: A policy block for a user or group this machine lacks is dropped whole.
  • POL-006: An at_console block, decided only at run time.
  • POL-007: A bus refuses its configuration, or a file isn't well-formed.

Related