D-Bus mediation

the bus daemon decides for application developers for administrators for security researchers

The parser compiles dbus rules into the profile and the kernel has no D-Bus hook. The bus daemon reads the label of each connection and asks the kernel through the .access file what that label allows and then delivers or drops the message itself and writes the record. A daemon that does not ask enforces nothing. The mainline kernel since 6.17 answers yes to every dbus question for a profile compiled under abi/3.0 or abi/4.0 and Ubuntu kernels do not.

On the map: libapparmor

▶ Watch this deck — 9 scenes, ~7 min

Worth seeing first

Part of journeys

01 A dbus rule, and no kernel hook to check it

D-BUS MEDIATION dbus send bus=system path=/org/demo interface=org.demo.Api peer=(name=org.demo), demo's profile: a rule for one service, on the system bus $ aa-exec -p demo -- busctl --system call org.freedesktop.login1 ... ListSessions Call failed: Access denied demo system bus daemon login service a unix socket the kernel: bytes on a unix socket, and no D-Bus hook the bus daemon asks it: what does demo's profile allow? the question the record when nobody asks when the answer is always yes the rule syntax: the D-Bus rules deck
demo's profile has one dbus rule, for the service org.demo on the system bus. demo, run with aa-exec -p demo, calls the login service instead and gets Access denied. demo is connected to the system bus daemon by a unix socket; the daemon does not deliver the call to the login service. The kernel sees bytes on a unix socket and has no D-Bus hook; the bus daemon asks it what demo's profile allows. The deck covers the question, the record, when nobody asks and when the answer is always yes. The rule syntax is in the D-Bus rules deck.

dbus rules are compiled into the profile, but the kernel has no D-Bus hook. The bus daemon asks the kernel what the profile allows and enforces the answer itself. This deck is for application developers, administrators and security researchers.

Demo's profile has a dbus rule for one service, org.demo. So what happens when demo calls the login service instead? Access denied. But who said no? Not the kernel. To the kernel that call is bytes on a unix socket; it has no idea what a D-Bus message is. The bus daemon said no. It looked at the message, asked the kernel what demo's profile allows, and refused to pass it on. This deck follows that question, reads the line the daemon logs, and then looks at the cases where nobody asks, or the answer is always yes. The rule syntax has its own deck.

Details and sources

Details

  • Seen on a Debian sid guest (kernel 7.3.4, a distribution kernel without Ubuntu's AppArmor patches; dbus-daemon 1.16.4), with profiles compiled by the parser of the AppArmor commit the map describes. The example uses the system bus, because the system bus daemon writes audit records; the D-Bus rules deck uses the session bus.
  • The rule on the slide is one of four dbus rules in the profile demo of the runs. The others allow Hello, GetId, RequestName, ReleaseName, AddMatch and RemoveMatch on the bus daemon itself, owning org.demo.client, and receiving the signal Changed. Without a send rule for Hello a program cannot use the bus at all.
  • The full command was aa-exec -p demo -- busctl --system call org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager ListSessions; it printed Call failed: Access denied and exited 1. org.freedesktop.login1 is systemd-logind, which is unconfined on the guest.
  • dbus-send shows the daemon's full error: Error org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.61" (uid=0 pid=1701 comm="dbus-send --system --print-reply --dest=org.freede" label="demo (enforce)") interface="org.freedesktop.login1.Manager" member="ListSessions" error name="(unset)" requested_reply="0" destination="org.freedesktop.login1" (uid=0 pid=764 comm="/usr/lib/systemd/systemd-logind" label="unconfined").
  • The kernel's only code for the dbus class is the query file /sys/kernel/security/apparmor/.access (apparmorfs.c:859-898), the feature file features/dbus/mask (apparmorfs.c:2662-2664) and a class name for records. No hook looks at D-Bus messages.
  • The connection to the bus is a unix socket and needs its own rules: /run/dbus/system_bus_socket rw, and a unix rule. See Unix socket rules.
  • The bus daemon is in neither source tree the map describes. Statements about it come from the source package dbus 1.16.4-1 of Debian sid (bus/apparmor.c, named by function) and from the runs; they have no pinned link.

02 The bus daemon asks, the kernel answers

THE QUESTION demo bus daemon who is this? label: demo kept while the connection lives labeldemo bussystem nameorg.freedesktop.login1 peer labelunconfined path/org/freedesktop/login1 interfaceorg.freedesktop.login1.Manager memberListSessions write /sys/kernel/security/apparmor/.access demo's compiled profile the question is walked through it, like a file name read allow 0x00000000 deny 0x00000000 audit 0x00000000 quiet 0x00000000 send is not in allow the daemon decides: deliver or drop libapparmor: aa_query_label()
demo connects to the bus daemon; the daemon learns the label demo from the socket and keeps it while the connection lives. For a message the daemon writes a question to /sys/kernel/security/apparmor/.access: label demo, bus system, name org.freedesktop.login1, peer label unconfined, path /org/freedesktop/login1, interface org.freedesktop.login1.Manager, member ListSessions. The kernel walks the question through demo's compiled profile and the daemon reads the reply: allow 0x00000000, deny 0x00000000, audit 0x00000000, quiet 0x00000000. Send is not in allow. The daemon decides whether to deliver or drop. libapparmor's function for this is aa_query_label.

The daemon reads the peer's label from the socket when a program connects. For each check it writes a query to /sys/kernel/security/apparmor/.access and reads back allow, deny, audit and quiet. libapparmor wraps this as aa_query_label().

It takes two steps. When demo connects, the daemon asks the socket who is at the other end, and the kernel answers with a label: demo. The daemon keeps it for as long as the connection lives. Then, for each message, it writes a question into the .access file in apparmorfs: this label, this bus, this destination, this path, interface and member. The kernel runs that string through demo's compiled profile, much as it would a file name, and hands back four masks: allow, deny, audit and quiet. What to do with them is the daemon's business. In libapparmor the whole exchange is one call, aa_query_label.

Details and sources

Details

  • Seen on a Debian sid guest (kernel 7.3.4, a distribution kernel without Ubuntu's AppArmor patches; dbus-daemon 1.16.4), with profiles compiled by the parser of the AppArmor commit the map describes. The reply on the slide is what the kernel returned for exactly this question when it was written to .access by a test script as root.
  • The label of a connection: dbus-daemon calls aa_getpeercon() on the connection's socket once, when the connection is set up (bus_apparmor_init_connection_confinement). int aa_getpeercon(int fd, char **label, char **mode); reads the socket option SO_PEERSEC and splits demo (enforce) into the label and the mode (kernel.c:1300-1320, kernel.c:1363-1400).
  • The question: int aa_query_label(uint32_t mask, char *query, size_t size, int *allowed, int *audited); (kernel.c:1425-1510). The caller leaves room at the start of query; the function puts label and a zero byte there, opens .access, writes the query once and reads 67 bytes.
  • The fields on the slide are joined by zero bytes after the label and one class byte. Their order in the string is bus, name, peer label, path, interface, member; see the reference below and the scene "Compiled by the parser, asked for by the bus daemon" in D-Bus rules.
  • The reply is four lines: allow 0x%08x, deny 0x%08x, audit 0x%08x, quiet 0x%08x (apparmorfs.c:1068-1070). Permission bits: send 0x2, receive 0x4, eavesdrop 0x20, bind 0x40 (apparmor.h:60-65). For demo's own rule the reply was allow 0x00008002; bit 0x8000 is added by the kernel to every permission set of an older-format table and is not a dbus permission.
  • libapparmor's verdict: allowed when every asked bit is in allow and not in deny; to be logged when the query is refused and the bit is not in quiet, or allowed and the bit is in audit (kernel.c:1498-1501).
  • .access has mode 0666 (apparmorfs.c:2704). The kernel finds the label in the namespace of the writing task, starts from "everything allowed" and lets each profile of the label narrow the answer (apparmorfs.c:1022-1071). A label the kernel does not know makes the write fail with ENOENT; the daemon then refuses the message and logs info=.
  • The feature file features/query/label/perms contains allow deny audit quiet.
  • The bus daemon is in neither source tree the map describes. Statements about it come from the source package dbus 1.16.4-1 of Debian sid (bus/apparmor.c, named by function) and from the runs; they have no pinned link.

03 One message, two questions

SEND AND RECEIVE demo profile demo bus daemon org.demo profile demo-service Reset() question 1, about demo send peer label: demo-service dbus send bus=system path=/org/demo interface=org.demo.Api peer=(name=org.demo), question 2, about demo-service receive peer label: demo dbus receive bus=system path=/org/demo interface=org.demo.Api member=Status peer=(label=demo), yes no apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/demo" interface="org.demo.Api" member="Reset" name=":1.14" mask="receive" pid=1482 label="demo-service" peer_pid=1504 peer_label="demo" an unconfined side: not asked the reply to a delivered call: not asked
demo, under the profile demo, sends the method call Reset through the bus daemon to org.demo, which runs under the profile demo-service. Question 1, about demo: send, peer label demo-service; demo's rule covers the whole interface org.demo.Api, so the answer is yes. Question 2, about demo-service: receive, peer label demo; its rule accepts only member Status, so the answer is no and the call is not delivered. The record has mask receive, label demo-service and peer_label demo. An unconfined side is not asked, and the reply to a delivered call is not asked about.

send is asked of the sender's profile and receive of the recipient's, each with the other side's label as the peer. An unconfined side is not asked, and neither is anyone for a reply that was requested.

For a message from demo to the service, the daemon asks twice. May demo send this, to a peer with the service's label? And may the service receive it, from a peer labelled demo? Both answers must be yes. Here demo's rule covers the whole interface, but the service accepts only the Status method. So a Reset call is stopped by the receiver's profile, and the record names the service, not demo. Two shortcuts. A side that's unconfined isn't asked at all. And the reply to a call that got through goes back with no questions. You write rules for requests, not for answers.

Details and sources

Details

  • Seen on a Debian sid guest (kernel 7.3.4, a distribution kernel without Ubuntu's AppArmor patches; dbus-daemon 1.16.4), with profiles compiled by the parser of the AppArmor commit the map describes. org.demo was owned by dbus-test-tool echo --system --name=org.demo (package dbus-tests) running under the profile demo-service; it answers every method call with an empty reply.
  • Seen: aa-exec -p demo -- busctl --system call org.demo /org/demo org.demo.Api Status returned with exit status 0 and no record. The same call with Reset printed Call failed: Access denied. The record on the slide is that denial, without its prefix audit: type=1107 audit(1794836373.212:170): pid=755 uid=993 auid=4294967295 ses=4294967295 subj=unconfined msg=' and broken over three lines.
  • In a receive record name= is the sender's unique name (:1.14); in a send record it is the destination.
  • Seen: an unconfined busctl calling Status on org.demo was refused as well, by the service's rule, which names peer=(label=demo); the record has mask="receive" label="demo-service" peer_label="unconfined". The unconfined sender was not asked about; the confined recipient was.
  • The reply: demo has no receive rule for it and demo-service no send rule, and the Status call still returned. dbus-daemon allows a requested reply, one that the recipient had asked for, without a query (bus_apparmor_allows_send, the requested_reply branch); an unrequested reply is queried like any message, and method returns and errors are not logged.
  • Signals are checked the same way, per recipient: a confined dbus-monitor under demo received the signal Changed and not Other; the record was operation="dbus_signal" ... mask="receive" ... label="demo" peer_pid=1551 peer_label="unconfined".
  • When the recipient is the bus daemon itself (org.freedesktop.DBus), the peer label is the daemon's own label, unconfined on the guest. When a message would start a service, only the sender is asked.
  • The message is delivered only if both answers allow it. A profile in complain mode is treated as allowing and the record says ALLOWED: see the reference below.
  • The bus daemon is in neither source tree the map describes. Statements about it come from the source package dbus 1.16.4-1 of Debian sid (bus/apparmor.c, named by function) and from the runs; they have no pinned link.

04 Owning a name, and listening in

BIND AND EAVESDROP bind asks with system org.demo.other the busthe name $ aa-exec -p demo -- busctl ... RequestName su org.demo.client 0 u 1 $ aa-exec -p demo -- busctl ... RequestName su org.demo.other 0 Call failed: Access denied operation="dbus_bind" bus="system" name="org.demo.other" mask="bind" pid=1533 label="demo" asked before the bus's own policy file $ aa-exec -p demo -- busctl ... AddMatch s "eavesdrop=true,..." Call failed: Access denied system the bus alone $ aa-exec -p demo -- busctl --system call org.demo /org/demo org.demo.Api Status delivered $ aa-exec -p demo -- busctl --system call :1.11 /org/demo org.demo.Api Status Access denied mask="send" name=":1.11" pid=1518 label="demo" peer_pid=1482 peer_label="demo-service" peer=(name=org.demo) is compared with the destination as the caller wrote it :1.11 is the unique name of the connection that owns org.demo
A bind question carries two fields, the bus system and the name. demo asks for org.demo.client and gets it; it asks for org.demo.other and gets Access denied, with a record operation dbus_bind, name org.demo.other, mask bind, label demo, written before the bus's own policy file is consulted. An eavesdrop question carries the bus alone; demo's AddMatch with eavesdrop=true is denied. A call made under the profile demo and addressed to org.demo is delivered; the same call addressed to :1.11, the unique name of the connection that owns org.demo, is denied with name :1.11, because peer=(name=org.demo) is compared with the destination as written.

A bind query carries the bus and the name; an eavesdrop query only the bus. In a message query the name is the destination as the caller wrote it, so peer=(name=org.demo) does not match a call addressed to :1.11.

Two more questions, both shorter. When a program asks to own a name, the daemon asks the kernel about bind, with only the bus and the name. Demo has a rule for one name and gets it. A second name is refused, before the bus's own policy file is even looked at. When a program asks to see messages meant for others, the question is eavesdrop, with the bus alone. One more thing about names. The daemon passes on the destination exactly as the caller wrote it. Address the service by its connection number instead, and a rule that names the peer org.demo doesn't match.

Details and sources

Details

  • Seen on a Debian sid guest (kernel 7.3.4, a distribution kernel without Ubuntu's AppArmor patches; dbus-daemon 1.16.4), with profiles compiled by the parser of the AppArmor commit the map describes. Commands are shortened on the slide where ... stands: each of the first three was aa-exec -p demo -- busctl --system call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus ... with RequestName su NAME 0 or AddMatch s "eavesdrop=true,type='signal',interface='org.demo.Api'". The aa-exec -p demo -- in front matters: the same busctl call to org.demo from an unconfined shell was refused, by the service's profile (the scene "One message, two questions"). Records are shown without their prefix and without apparmor="DENIED".
  • u 1 is the bus daemon's answer "you are now the primary owner". The guest's bus policy allowed root to own names starting with org.demo; dbus-daemon asks AppArmor before it looks at that policy (bus/services.c, before bus_client_policy_check_can_own).
  • The profile's rule is dbus bind bus=system name=org.demo.client,. The feature file calls this permission acquire; the rule and the record say bind.
  • The eavesdrop record: operation="dbus_eavesdrop" bus="system" mask="eavesdrop" pid=1540 label="demo". dbus-daemon asks this for a match rule with eavesdrop=true and for BecomeMonitor. dbus-monitor tries BecomeMonitor first, then an eavesdropping match, then a plain match; under demo that left one send denial (interface org.freedesktop.DBus.Monitoring) and one eavesdrop denial before it received anything.
  • The name: dbus-daemon puts the message's destination field into the query, or org.freedesktop.DBus when the message has none. Seen: the call addressed to :1.11 was refused with the record on the slide, although :1.11 was the connection that owned org.demo.
  • By the same code a deny rule with peer=(name=org.demo) does not cover a call addressed to the unique name. This was derived from the source, not run. peer=(label=...) does not depend on how the caller addressed the message.
  • dbus-broker, by its source, asks once for every name the peer owns and refuses if any is refused. It was not run for this deck.
  • The bus daemon is in neither source tree the map describes. Statements about it come from the source package dbus 1.16.4-1 of Debian sid (bus/apparmor.c, named by function) and from the runs; they have no pinned link.

05 The denial is written by the bus daemon

THE RECORD audit: type=1107 audit(1794836423.395:190): pid=755 uid=993 auid=4294967295 ses=4294967295 subj=unconfined msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/login1" interface="org.freedesktop.login1.Manager" member="ListSessions" mask="send" name="org.freedesktop.login1" pid=1671 label="demo" peer_pid=764 peer_label="unconfined" type=1107 pid=755 written by the bus daemon operation="dbus_method_call" a method call bus path interface member the words of the rule mask="send" the question that failed label="demo" the profile that was asked peer_label="unconfined" the other side dbus send bus=system path=/org/freedesktop/login1 interface=org.freedesktop.login1.Manager member=ListSessions peer=(label=unconfined), the rule that would allow it dbus-daemon[1687]: apparmor="DENIED" operation="dbus_method_call" bus="session" ... a session bus: the same text, as a line in the system log
The record of demo's refused call to the login service: audit type=1107, pid=755 uid=993, subj=unconfined, then msg= with apparmor DENIED, operation dbus_method_call, bus system, path /org/freedesktop/login1, interface org.freedesktop.login1.Manager, member ListSessions, mask send, name org.freedesktop.login1, pid=1671, label demo, peer_pid=764, peer_label unconfined. type=1107 and pid=755: written by the bus daemon. operation: a method call. bus, path, interface, member: the words of the rule. mask: the question that failed. label: the profile that was asked. peer_label: the other side. The rule that would allow it is dbus send bus=system path=/org/freedesktop/login1 interface=org.freedesktop.login1.Manager member=ListSessions peer=(label=unconfined). A session bus writes the same text to the system log, as a line from dbus-daemon.

A D-Bus record has type=1107 and the bus daemon's pid; the AppArmor fields are inside msg='...'. mask is the permission asked, label the profile asked, peer_label the other side. A session bus writes the same text to the system log.

Here's the refusal in the log. The type is 1107, a record from a user-space program, and the process ID in front is the bus daemon's, because the daemon wrote it. The AppArmor part sits inside the message field. Operation says it was a method call. Bus, path, interface and member are the words of the rule you'd write. Mask says which question failed, send or receive. Label is the profile that was asked; peer label is the other side. Read it like a file denial, and you have the rule. A user's session bus can't write audit records, so the same text lands in the system log.

Details and sources

Details

  • Seen on a Debian sid guest (kernel 7.3.4, a distribution kernel without Ubuntu's AppArmor patches; dbus-daemon 1.16.4), with profiles compiled by the parser of the AppArmor commit the map describes. The record is quoted in full up to peer_label; in the kernel log it is two lines, because dbus-daemon ends its text with a newline and the audit library appends exe="/usr/bin/dbus-daemon" sauid=993 hostname=? addr=? terminal=?' after it. journalctl -k | grep apparmor= shows only the first line. There are two spaces after operation="dbus_method_call"; the slide breaks the line there.
  • type=1107 is USER_AVC, a record sent by a user-space program. The kernel's own AppArmor records are type=1400: see Reading a denial. With the audit daemon running, both kinds go to /var/log/audit/audit.log; without it, to the kernel log (dmesg, journalctl -k). No audit daemon ran on the guests, so the audit.log form of this record was not seen.
  • Before msg=: pid=755 uid=993 subj=unconfined describe the bus daemon (user messagebus, its own label). Inside msg=: pid=1671 is the process of the profile that was asked and peer_pid=764 the other side; peer_pid is missing when the peer is the bus daemon itself.
  • operation is dbus_ and the message type (dbus_method_call, dbus_signal), or dbus_bind, or dbus_eavesdrop. mask is one of send, receive, bind, eavesdrop.
  • name: in a send record the destination as the caller wrote it, in a receive record the sender's unique name, in a bind record the name asked for.
  • The rule on the slide uses peer=(label=unconfined) from peer_label; peer=(name=org.freedesktop.login1) from name is the other choice. Neither is a recommendation to add it.
  • apparmor="ALLOWED" appears for a profile in complain mode. Seen under demo-complain: the login call, the name and the eavesdropping match all succeeded, each with an ALLOWED record.
  • The session bus: a bus started by the user tester with dbus-run-session logged Nov 16 13:40:24 aamap dbus-daemon[1687]: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/org/freedesktop/DBus" interface="org.freedesktop.DBus" member="Hello" mask="send" name="org.freedesktop.DBus" pid=1688 label="demo" peer_label="unconfined" in the journal and no type 1107 record. The system bus daemon keeps the capability to write audit records (CapEff: 0000000020000000); a user's daemon does not have it and uses syslog.
  • dbus-broker writes type 1107 records too. On an Ubuntu 26.10 guest (dbus-broker 37-5ubuntu5): apparmor="DENIED" operation="dbus_method_call" bus="system" path="/" interface="org.freedesktop.DBus" member="ListNames" mask="send" name="org.freedesktop.DBus" label="demo-dbus" peer_label="unconfined" exe="/usr/bin/dbus-broker" sauid=0 hostname=? addr=? terminal=?': one line, one space after operation, no pid=.
  • The bus daemon is in neither source tree the map describes. Statements about it come from the source package dbus 1.16.4-1 of Debian sid (bus/apparmor.c, named by function) and from the runs; they have no pinned link.

06 When the bus daemon doesn't ask

NO QUESTION, NO DENIAL the bus daemon starts is AppArmor enabled? features/dbus/mask is this file there? demo bus daemon login service no question if not: it starts anyway, delivers everything and logs nothing a daemon built without AppArmor behaves the same $ aa-exec -p demo -- busctl --system call org.freedesktop.login1 ... ListSessions a(susso) 2 "8" 0 "root" "" "/org/freedesktop/login1/session/_38" "2" 0 "root" ... a guest with kernel 6.12: mainline has the dbus entry from 6.17 $ busctl --system get-property org.freedesktop.DBus /org/freedesktop/DBus \ org.freedesktop.DBus Features as 4 "ActivatableServicesChanged" "AppArmor" "HeaderFiltering" "SystemdActivation" as 3 "ActivatableServicesChanged" "HeaderFiltering" "SystemdActivation" not mediating <apparmor mode="required"/> in the bus configuration: no mediation, no start
When the bus daemon starts it checks whether AppArmor is enabled and whether the file features/dbus/mask exists. If not, it starts anyway: demo's call goes through the daemon to the login service with no question, it is delivered and nothing is logged. A daemon built without AppArmor behaves the same. On a guest with kernel 6.12, demo's call to the login service returned the list of sessions; mainline has the dbus entry from 6.17. The check: busctl get-property of Features on org.freedesktop.DBus prints four entries including AppArmor when the daemon mediates and three entries without it when it does not. The bus configuration element apparmor mode=required makes the daemon refuse to start without mediation.

dbus-daemon mediates only when AppArmor is enabled and features/dbus/mask exists, which mainline has from 6.17. Otherwise everything is delivered and nothing is logged. Its Features property lists AppArmor when it mediates; <apparmor mode="required"/> makes it refuse to start without.

All of this assumes a daemon that asks. When it starts, the bus daemon checks two things: is AppArmor on, and does the kernel's feature directory have a dbus entry? If not, it starts anyway and mediates nothing. Every message is delivered and nothing is logged. A daemon built without AppArmor behaves the same. Mainline kernels before 6.17 had no such entry. On a test machine with one of those, demo called the login service, took a name it had no rule for, and eavesdropped. To check a running bus, read its Features property: with mediation on, the list includes AppArmor. The bus configuration can also require it.

Details and sources

Details

  • dbus-daemon decides once, at startup (bus_apparmor_pre_init, bus_apparmor_full_init): it mediates if it was built with AppArmor, aa_is_enabled() is true and it can open features/dbus/mask under apparmorfs. It does not look at the file's content. Debian and Ubuntu build it with AppArmor and the audit library on Linux.
  • The mainline kernel has the dbus feature entry from 6.17 (apparmorfs.c:2662-2664, apparmorfs.c:2697); Ubuntu kernels have had it since at least 6.8. See Upstream and Ubuntu kernels.
  • Seen on a Debian 13 guest (kernel 6.12.116, dbus-daemon 1.16.2, linked with libapparmor): no features/dbus/mask; Features printed the three entries on the slide; under the profile demo every attempt of this deck succeeded with no record: the call to the login service, a Reset call to the confined service, owning org.demo.other, the eavesdropping match and both signals.
  • On that kernel the parser also leaves the dbus rules out of the compiled profile. It says so only when asked: Warning from profile demo (demo.sd): dbus rules not enforced with --warn=all or --warn=rule-not-enforced (dbus.cc:203, dbus.cc:220-223). See Kernel features and the policy ABI.
  • Seen on Debian sid and Ubuntu 26.04: Features printed as 4 "ActivatableServicesChanged" "AppArmor" "HeaderFiltering" "SystemdActivation", and the journal had [system] AppArmor D-Bus mediation is enabled.
  • The bus configuration element is <apparmor mode="enabled"/> (the default: mediate if possible), "disabled" or "required". With required and no mediation dbus-daemon fails to start with AppArmor mediation required but not present. The configuration files shipped on the guests have no such element. The required case was read in the source, not run.
  • dbus-broker, by its source: its launcher reads /sys/module/apparmor/parameters/enabled and requires the words acquire, send and receive in features/dbus/mask; without them it prints Kernel is missing AppArmor DBus support. and continues without mediation.
  • A side that is unconfined is not asked about on any kernel, and neither is anyone for a requested reply: see the scene "One message, two questions".
  • The bus daemon is in neither source tree the map describes. Statements about it come from the source package dbus 1.16.4-1 of Debian sid (bus/apparmor.c, named by function) and from the runs; they have no pinned link.

07 Old ABI, new kernel: every answer is yes

THE SAME RULES, ONE LINE CHANGED allow 0xffffffff deny 0x00000000 audit 0x00000000 quiet 0xffffffff yes to everything mainline since 6.17: a dbus question skips a profile that does not also mediate the newer network class (network_v9) abi <abi/5.0>,has network_v9 abi <abi/4.0>,dbus, no network_v9 abi <abi/3.0>,dbus, no network_v9 abi <abi/5.0>, profile demo { dbus send bus=system path=/org/demo ... abi <abi/4.0>, profile demo-abi4 { dbus send bus=system path=/org/demo ... on a mainline-based kernel (7.3), calling the login service allow 0x00000000 Access denied, and a record allow 0xffffffff the call is answered, no record on Ubuntu 26.04 (kernel 7.0): both refused, both logged
The kernel's reply allow 0xffffffff, deny 0, audit 0, quiet 0xffffffff means yes to everything. Mainline since 6.17: a dbus question skips a profile that does not also mediate the newer network class, network_v9. abi/5.0 has network_v9; abi/4.0 and abi/3.0 have dbus and no network_v9. Two profiles with the same dbus rule: demo with abi/5.0 and demo-abi4 with abi/4.0. On a mainline-based kernel 7.3, demo gets allow 0x00000000, the login call is denied and a record is written; demo-abi4 gets allow 0xffffffff, the login call is answered and there is no record. On Ubuntu 26.04 with kernel 7.0 both are refused and both are logged.

On mainline 6.17 and later the kernel leaves a profile out of dbus queries unless it mediates the v9 network class, which profiles compiled under abi/3.0 or abi/4.0 do not. Their dbus rules load and are not consulted. Ubuntu kernels consult them.

Now the quiet case: the daemon asks, and the kernel says yes to everything. Since 6.17, mainline skips a profile in a D-Bus question unless the profile also uses the newer network mediation. A profile gets that only when its feature set has it. abi/5.0 does. abi/4.0 and abi/3.0 don't. So we changed one line of demo's profile to abi/4.0. On a mainline-based kernel its dbus rules were loaded and not consulted: the login call went through, with no record and no word from the parser. Ubuntu's kernels don't have that test; there, the profile was enforced.

Details and sources

Details

  • Known discrepancy: Kernel: dbus rules of a profile compiled without network_v9 unix support are not consulted, so profiles that pin abi/3.0 or abi/4.0 get no dbus mediation. It is on the map's bug list under that title; this deck's runs are the first to reproduce it.
  • The test in the kernel: when a query's class is dbus and the profile does not mediate network class 15, the profile adds nothing to the answer, and the answer starts as "everything allowed" (apparmorfs.c:882-889, apparmorfs.c:1056-1065). The comment there gives the reason: "old user space does not correctly detect dbus mediation support so we may get dbus policy and requests when the abi doesn't support it. This can cause mediation regressions, so explicitly test for this situation." The test is in mainline from 6.17. None of the Ubuntu kernel sources read (6.8, 6.11, 6.14, 6.17, 7.0, 7.3) has it: 6.8 to 6.14 are older than the test, and Ubuntu 6.17, 7.0 and 7.3 revert the patch.
  • The parser side: the marker for network class 15 is added only when both the kernel and the policy feature set have network_v9/af_unix (parser_regex.c:1424-1432); the dbus marker and the dbus rules are added whenever both have dbus (parser_regex.c:1406-1408). The tree's abi/3.0 and abi/4.0 list dbus and no network_v9.
  • Seen on Debian sid (kernel 7.3.4, dbus-daemon 1.16.4). demo and demo-abi4 differ only in the abi line.
ProfileCompiled byReply to "send ListSessions to login1"The call
demo, abi <abi/5.0>,the tree's parserallow 0x00000000Access denied, record
demo-abi4, abi <abi/4.0>,the tree's parserallow 0xffffffff ... quiet 0xffffffffanswered, no record
demo-abi3, abi <abi/3.0>,the tree's parserallow 0xffffffffanswered, no record
abi <abi/4.0>,Debian's parser 5.0.2allow 0xffffffffanswered, no record
no abi rulethe tree's parser, no parser.confallow 0xffffffffanswered, no record
no abi ruleDebian's parser with its parser.confallow 0x00000000Access denied, record
  • The same four profiles also acquired org.demo.other, registered an eavesdropping match and received both signals, with no record.
  • A profile with no abi rule is compiled against the parser's built-in default feature set unless parser.conf sets policy-features; that default has dbus and no network_v9 (default_features.c:127-136). Debian's parser.conf points to a file that has both.
  • Seen on Ubuntu 26.04 (kernel 7.0.0-43, dbus-daemon 1.16.2): all six profiles were answered by their rules and every attempt was refused and logged.
  • What the parser printed for demo-abi4 on Debian sid: nothing by default. With --warn=all: a note that an included abstraction declares another abi, and three times downgrading extended network unix socket rule to generic network rule. Nothing about dbus.
  • What pins what: every abi rule in the profiles of the AppArmor tree is abi <abi/5.0>,. Profiles written for the 3.x and 4.x releases pin abi/3.0 and abi/4.0: the Debian 13 guest ships 97 profiles with abi <abi/4.0>,, four of them with dbus rules or dbus abstractions; the Ubuntu 26.04 guest ships three with abi <abi/3.0>,.
  • To check a loaded profile, ask the kernel directly: the reply allow 0xffffffff to a dbus question about a confined label means the profile was skipped. A script that does it is in the research notes of this deck.

08 What you are trusting for security researchers

FOR AN AUDIT the bus daemon a user-space process, the enforcer the label taken once, when it connects unconfined that label is not asked about the kernel's answer allows all for a skipped profile complain mode the daemon reads the mode -rw-rw-rw- .access anyone may ask about any label bus names are claims prefer peer=(label=...)
The bus daemon is the enforcer, a user-space process. Around it, what it takes on trust: the label, taken once when a program connects; the word unconfined, a label that is not asked about; the kernel's answer, which allows everything for a skipped profile; complain mode, which the daemon applies by reading the mode; the .access file with mode rw for everyone, so anyone may ask about any label; and bus names, which are claims, so prefer peer=(label=...).

The enforcement point is the bus daemon. It takes the label at connect time, skips peers labelled unconfined, applies complain mode itself and believes the kernel's reply. .access has mode 0666. A name is a claim; peer=(label=...) names the confinement.

For an audit, be clear about what does the enforcing. It's a user-space process, and it trusts three things. The label, which it takes once, when the connection is made, not per message. The word unconfined: a peer with that label isn't asked about. And the kernel's answer, which on a mainline kernel allows everything for any profile compiled against an older feature set. Complain mode is the daemon's doing too; it reads the mode next to the label. And the .access file is open to everyone, so any process that can reach it can ask what any label may do. Bus names are claims. Prefer a peer label.

Details and sources

for security researchers

Details

  • The label: dbus-daemon stores the result of aa_getpeercon() when the connection is set up and uses it for every later check (bus_apparmor_init_connection_confinement; kernel.c:1363-1400). Derived, not run: a program that changes profile after connecting is still asked about under the label of the connection.
  • Unconfined: the daemon skips the query when the mode is unconfined, or when there is no mode and the label is the string unconfined (is_unconfined). The kernel does the same on its side: an unconfined profile leaves the answer at "everything allowed" (apparmorfs.c:867-868).
  • The kernel's answer: see the scene "Old ABI, new kernel: every answer is yes". Seen on Debian sid: allow 0xffffffff deny 0x00000000 audit 0x00000000 quiet 0xffffffff for every dbus question about a profile compiled under abi/3.0 or abi/4.0, the same reply as for unconfined.
  • Complain mode: the reply for a complain-mode profile is the same as for an enforcing one (allow 0x00000000 for the login call under demo-complain); the daemon turns the refusal into ALLOWED because the mode string that came with the label is complain.
  • A failed query (unknown label, no .access) is a refusal with info= in the record, by the source; not run.
  • .access is -rw-rw-rw- 1 root root on the guests (apparmorfs.c:2704). The kernel code has no check of the caller before it answers a permission query (apparmorfs.c:1204-1240); a confined task needs a file rule for the path. The answer reveals what a label may do, for any class the query names.
  • A label that nothing runs under and no profile has, such as the stack demo//&demo-abi4, got ENOENT (seen). For a live stack the kernel intersects the profiles' answers (apparmorfs.c:1056-1065); not run.
  • Names: peer=(name=...) is as strong as the bind rules of every other profile on the bus, and unconfined programs are not bound by them. With dbus-daemon the name is also the destination as the caller wrote it (the scene "Owning a name, and listening in").
  • A session bus is started by the user it serves. Whether that daemon mediates, and with which configuration, is in that user's hands.
  • The bus daemon is in neither source tree the map describes. Statements about it come from the source package dbus 1.16.4-1 of Debian sid (bus/apparmor.c, named by function) and from the runs; they have no pinned link.

09 From the bus to the rule, the record and the kernel

CHECK, THEN ROADS the bus daemon asks, the kernel answers on your own system $ busctl --system get-property ... Features lists "AppArmor": the bus daemon mediates /sys/kernel/security/apparmor/features/dbus/mask exists: the kernel has the dbus entry abi <abi/5.0>, in the profile, on a mainline kernel: consulted syn-dbus write the rules adm-denials read records upstream-and-ubuntu the two kernels syn-abi the abi line adm-features what your kernel offers lib-query the query interface syn-unix the socket to the bus
The bus daemon asks and the kernel answers. Three things to check on your own system: the Features property of the bus, read with busctl, lists AppArmor, so the bus daemon mediates; the file /sys/kernel/security/apparmor/features/dbus/mask exists, so the kernel has the dbus entry; and on a mainline kernel the profile has the line abi abi/5.0, so its dbus rules are consulted. Roads: syn-dbus to write the rules, adm-denials to read records, upstream-and-ubuntu for the two kernels, syn-abi for the abi line, adm-features for what your kernel offers, lib-query for the query interface and syn-unix for the socket to the bus.

Check that the bus's Features property lists AppArmor, that features/dbus/mask exists, and, on a mainline kernel, that the profile is compiled under abi/5.0. Roads: the rule syntax, reading records, upstream and Ubuntu kernels, the abi rule, kernel features, the query interface and unix socket rules.

So a dbus rule is only as good as the daemon that asks and the kernel that answers. On your own system, check three things. The bus's Features property lists AppArmor. The kernel's feature directory has a dbus entry. And on a mainline kernel, the profile pins abi/5.0. From here, the D-Bus rules deck is where you write the rules, and reading a denial covers records in general. Upstream and Ubuntu kernels lists what else differs, and the abi rule deck explains that one line. Kernel features lists what your kernel offers, the query interface sits underneath, and unix socket rules cover the hop to the bus.

Details and sources

Details

  • A dbus rule is enforced when three things hold: the bus daemon mediates (its Features property lists AppArmor), the kernel has the dbus feature entry, and the kernel consults the profile, which on mainline 6.17 and later needs a profile compiled with the v9 network class (abi <abi/5.0>,). A profile with no abi rule is compiled with that class only if policy-features in parser.conf names a feature file that has network_v9; see the scene "Old ABI, new kernel: every answer is yes".
  • The three checks of the slide, in full: busctl --system get-property org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus Features (seen: as 4 "ActivatableServicesChanged" "AppArmor" "HeaderFiltering" "SystemdActivation" when the daemon mediates); cat /sys/kernel/security/apparmor/features/dbus/mask (seen: acquire send receive); the abi line of the profile, and uname -r to know which kernel answers. For a session bus use busctl --user.
  • Commits read for this deck: AppArmor 836052d21 (6.0.0~alpha2) and the kernel tree named on the page; Ubuntu kernel tags 6.8 to 7.3; the source packages dbus 1.16.4-1, dbus 1.16.2-2ubuntu4 and dbus-broker 37-5 and 37-5ubuntu5. Behaviour was observed on Debian sid (kernel 7.3.4), Ubuntu 26.04 (kernel 7.0.0-43) and Debian 13 (kernel 6.12.116) guests.

Read more

Basis of the statements on this page: "seen" means it happened on a running guest: Debian sid (kernel 7.3.4, a distribution kernel without Ubuntu's AppArmor patches, dbus-daemon 1.16.4), Ubuntu 26.04 (kernel 7.0.0-43, dbus-daemon 1.16.2) or Debian 13 (kernel 6.12.116, dbus-daemon 1.16.2), under profiles compiled by the parser of the AppArmor commit 836052d21 unless another parser is named. "source" means the code was read and not run: the kernel tree the map describes, the AppArmor tree, the Ubuntu kernel tags 6.8 to 7.3, and the source packages dbus 1.16.4-1 and dbus-broker 37-5 and 37-5ubuntu5. The bus daemons are in neither tree the map describes, so statements about them carry no pinned link. Records are quoted without the prefix audit: type=1107 audit(SECONDS:SERIAL): pid=755 uid=993 auid=4294967295 ses=4294967295 subj=unconfined msg='. The rule syntax is in D-Bus rules.

When a dbus rule is enforced

All three must hold.

ConditionHow to checkIf not
the bus daemon mediatesbusctl --system get-property org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus Features lists AppArmor; the journal has AppArmor D-Bus mediation is enabledevery message is delivered, nothing is logged
the kernel has the dbus feature entry/sys/kernel/security/apparmor/features/dbus/mask exists (acquire send receive)the daemon does not mediate; the parser leaves dbus rules out (dbus rules not enforced, only with --warn=rule-not-enforced or --warn=all)
the kernel consults the profilea dbus question about the label is not answered allow 0xffffffffevery question about that profile is answered "allowed", nothing is logged
Kerneldbus feature entryProfiles consulted in a dbus query
mainline before 6.17 (seen: Debian 13, 6.12)nonone: no mediation
mainline 6.17 and later (seen: Debian sid, 7.3)yesonly profiles that mediate the v9 network class
Ubuntu 6.8 to 7.3 (seen: Ubuntu 26.04, 7.0)yesevery profile with the dbus class

The bus daemon's switch

dbus-daemonMediates
built without AppArmorno
AppArmor disabled in the kernel, or features/dbus/mask cannot be openedno
<apparmor mode="disabled"/> in the bus configurationno
<apparmor mode="enabled"/> or no such element (the default)if the two conditions above allow
<apparmor mode="required"/>yes, or it fails to start: AppArmor mediation required but not present

Source. The decision is made once, at startup. dbus-broker's launcher makes the same decision from /sys/module/apparmor/parameters/enabled and the words acquire, send and receive in features/dbus/mask, and prints Kernel is missing AppArmor DBus support. or AppArmor required, but not supported. Exiting.

The checks

EventPermissionLabel askedFields in the questionNot asked when
a message is to be deliveredsendthe sender'sbus, destination name, recipient's label, path, interface, memberthe sender is unconfined; the message is a requested reply
the same messagereceivethe recipient'sbus, sender's unique name, sender's label, path, interface, memberthe recipient is unconfined; requested reply; the message would start a service
RequestNamebindthe caller'sbus, namethe caller is unconfined
AddMatch with eavesdrop=true, BecomeMonitoreavesdropthe caller'sbusthe caller is unconfined
  • The label is the one the socket reported when the program connected (aa_getpeercon), with its mode.
  • The destination name is the message's destination field as written, or org.freedesktop.DBus when there is none. When the recipient is the bus daemon, the recipient's label is the daemon's own.
  • A message is delivered only if both questions allow it. A profile in complain mode counts as allowing; the record then says ALLOWED.
  • A question that fails (the kernel does not know the label, .access is missing) refuses the message; the record has info=. Source.
  • A broadcast signal is checked once per recipient.

Seen: the attempts of this deck

Debian sid; Ubuntu 26.04 gave the same results.

AttemptResultRecord
demo calls org.demo Statusempty replynone
demo calls org.demo ResetCall failed: Access deniedoperation="dbus_method_call" mask="receive" label="demo-service" peer_label="demo"
unconfined caller, org.demo Statusdeniedmask="receive" label="demo-service" peer_label="unconfined"
demo calls :1.11, the owner of org.demo, Statusdeniedmask="send" name=":1.11" label="demo" peer_label="demo-service"
demo calls login1 ListSessionsdeniedmask="send" name="org.freedesktop.login1" label="demo" peer_label="unconfined"
demo RequestName org.demo.clientu 1none
demo RequestName org.demo.otherdeniedoperation="dbus_bind" name="org.demo.other" mask="bind" label="demo"
demo AddMatch "eavesdrop=true,..."deniedoperation="dbus_eavesdrop" mask="eavesdrop" label="demo"
signal Changed to a dbus-monitor under demoreceivednone
signal Other to the samenot receivedoperation="dbus_signal" mask="receive" label="demo" peer_label="unconfined"
demo-complain: login1, org.demo.other, eavesdropall succeedthe same records with apparmor="ALLOWED"

The rules behind them:

# profile demo
dbus send bus=system path=/org/freedesktop/DBus interface=org.freedesktop.DBus
     member={Hello,GetId,RequestName,ReleaseName,AddMatch,RemoveMatch}
     peer=(name=org.freedesktop.DBus),
dbus send bus=system path=/org/demo interface=org.demo.Api peer=(name=org.demo),
dbus bind bus=system name=org.demo.client,
dbus receive bus=system path=/org/demo interface=org.demo.Api member=Changed,

# profile demo-service
dbus send bus=system path=/org/freedesktop/DBus interface=org.freedesktop.DBus
     peer=(name=org.freedesktop.DBus),
dbus bind bus=system name=org.demo,
dbus receive bus=system path=/org/demo interface=org.demo.Api member=Status peer=(label=demo),

What the client sees

RefusalD-Bus error org.freedesktop.DBus.Error.AccessDenied with the text
a messageAn AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.61" (uid=0 pid=1701 comm="..." label="demo (enforce)") interface="..." member="..." error name="(unset)" requested_reply="0" destination="org.freedesktop.login1" (uid=0 pid=764 comm="..." label="unconfined") (seen; the same text when the recipient's profile refuses)
a nameConnection "..." is not allowed to own the service "..." due to AppArmor policy (source)
eavesdroppingConnection "..." is not allowed to eavesdrop due to AppArmor policy (source)

busctl prints only Call failed: Access denied.

Record fields

FieldMeaningRule part
type=1107USER_AVC: sent by a user-space program
pid=, uid=, subj= before msg=the bus daemon's pid, user and own label
apparmor=DENIED; ALLOWED for complain mode or an audited allowed access
operation=dbus_method_call, dbus_signal, dbus_bind, dbus_eavesdropthe kind of rule
bus=system or sessionbus=
path=, interface=, member=the message's header fields; absent when the message has nonepath=, interface=, member=
mask=send, receive, bind or eavesdropthe permission
name=send: the destination as written; receive: the sender's unique name; bind: the name asked forpeer=(name=...); name= in a bind rule
pid= inside msg=the process of the label that was asked
label=the label that was askedthe profile to edit
peer_pid=, peer_label=the other side; peer_pid is absent when it is the bus daemonpeer=(label=...)
info=, peer_info=the error text when the question itself failed
exe=, sauid=, hostname=, addr=, terminal=added by the audit library
  • Seen: in the kernel log a dbus-daemon record is two lines; the second is exe="/usr/bin/dbus-daemon" sauid=993 hostname=? addr=? terminal=?'. The first line has no closing quote.
  • Seen: a session bus started by an ordinary user logs dbus-daemon[PID]: apparmor="DENIED" ... to the system log and no type 1107 record.
  • Not logged: an allowed access without audit; method returns and errors; anything when the daemon does not mediate or the kernel skips the profile.
  • Source: a refusal is logged unless the profile's quiet mask has the bit (a deny rule); an allowed access is logged when the audit mask has it. Not run.
  • Where records go and how the tools read them: Reading a denial.

Which profiles the mainline kernel consults

Seen on Debian sid (kernel 7.3.4). The six profiles have the same dbus rules.

Profileabi ruleCompiled byReply to a dbus questionlogin1 call, org.demo.other, eavesdrop, signal Other
demoabi <abi/5.0>,tree parserby the rulesrefused, logged
demo-abi4abi <abi/4.0>,tree parserallow 0xffffffff deny 0x00000000 audit 0x00000000 quiet 0xffffffffall succeed, no record
demo-abi3abi <abi/3.0>,tree parserthe sameall succeed, no record
demo-distro4abi <abi/4.0>,Debian's parser 5.0.2the sameall succeed, no record
demo-noabinonetree parser, no parser.confthe sameall succeed, no record
demo-distro-noabinoneDebian's parser, parser.conf with policy-features=by the rulesrefused, logged
  • Seen on Ubuntu 26.04 (kernel 7.0.0-43): all six were answered by the rules and refused.
  • Known discrepancy: Kernel: dbus rules of a profile compiled without network_v9 unix support are not consulted, so profiles that pin abi/3.0 or abi/4.0 get no dbus mediation.
  • The kernel test: apparmorfs.c:882-889, in mainline from 6.17; absent from the Ubuntu kernel sources 6.8, 6.11, 6.14, 6.17, 7.0 and 7.3 (source): the first three are older than the test, the others revert it.
  • Policy feature sets with dbus and without network_v9 in the AppArmor tree: abi/3.0, abi/4.0, abi/4.0-ip, abi/kernel-5.4-outoftree-network, and the parser's built-in default for profiles without an abi rule (default_features.c:127-136). With it: abi/5.0, abi/5.0-interface.
  • The parser adds the class marker the kernel tests for only when the policy feature set has network_v9/af_unix (parser_regex.c:1424-1432). It printed nothing about dbus for demo-abi4, with or without --warn=all.
  • Shipped profiles (seen): AppArmor tree, every abi rule is 5.0; Debian sid, 141 files with 5.0 and 2 without an abi rule; Ubuntu 26.04, 147 with 5.0, 3 with 3.0 and 4 without; Debian 13, 97 with abi <abi/4.0>,.

for application developers for security researchers

The query and the reply

write:  "label" 00  LABEL 00  20 BUS 00 NAME 00 PEERLABEL 00 PATH 00 INTERFACE 00 MEMBER     send, receive
        "label" 00  LABEL 00  20 BUS 00 NAME                                                 bind
        "label" 00  LABEL 00  20 BUS                                                         eavesdrop
read:   allow 0x%08x\ndeny 0x%08x\naudit 0x%08x\nquiet 0x%08x\n
  • File: /sys/kernel/security/apparmor/.access, mode 0666, one write and one read per open (apparmorfs.c:1204-1240, apparmorfs.c:1022-1071). 20 is the dbus class, 32.
  • int aa_query_label(uint32_t mask, char *query, size_t size, int *allowed, int *audited); (kernel.c:1425-1510). The first AA_QUERY_CMD_LABEL_SIZE bytes of query are overwritten with label and a zero byte.
  • Bits: send 0x2, receive 0x4, eavesdrop 0x20, bind 0x40. Bit 0x8000 in a reply is added by the kernel and is not a dbus permission.
  • allowed: every asked bit is in allow and none in deny. audited: refused and not in quiet, or allowed and in audit (kernel.c:1498-1501).
  • Errors: ENOENT the kernel does not know the label; EPROTONOSUPPORT no .access or an unexpected reply; EPROTO a short write or read.
  • Seen replies: demo, send Status to org.demo: allow 0x00008002; send ListSessions to login1: allow 0x00000000; bind org.demo.client: allow 0x00008040; demo-service, receive Status from label demo: allow 0x00008004, from unconfined: allow 0x00000000; label unconfined: allow 0xffffffff ... quiet 0xffffffff; an unknown label and the unused stack demo//&demo-abi4: ENOENT.
  • A stacked label is answered with what every profile in it allows (source).
  • More on the interface: Querying the policy.

dbus-broker

Source only (37-5 as packaged by Debian and Ubuntu 26.04, 37-5ubuntu5 of Ubuntu 26.10); not run for this deck.

  • The same three kinds of question through aa_query_label.
  • For a message it asks once for each name the peer owns and refuses if any is refused; a peer with no name is asked with its unique id. dbus-daemon asks with the one name the caller wrote.
  • Records are type 1107. In 37-5 a message record has method= where dbus-daemon has member= and no name=; 37-5ubuntu5 writes member=, name=, label= and peer_label=. A record of 37-5ubuntu5 seen on an Ubuntu 26.10 guest: apparmor="DENIED" operation="dbus_method_call" bus="system" path="/" interface="org.freedesktop.DBus" member="ListNames" mask="send" name="org.freedesktop.DBus" label="demo-dbus" peer_label="unconfined" exe="/usr/bin/dbus-broker" sauid=0 hostname=? addr=? terminal=?'.

Not determined

  • The form of a type 1107 record in /var/log/audit/audit.log; no guest ran the audit daemon.
  • A question about the stacked label of a running program, and a bus daemon inside a policy namespace.
  • dbus-broker's handling of replies and signals.

Roads from here

START HERE

PREAMBLE AND REUSE

PROFILE HEAD

RULE CLASSES

IN PRACTICE · general-purpose apps

SECURITY · threat model and limits

RUNNING THE PARSER

LIBAPPARMOR