summaryrefslogtreecommitdiff
path: root/bus/apparmor.h
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2014-02-13 13:07:32 -0600
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2015-02-18 18:59:23 +0000
commitd9a2fdb96adf18d6876406a6cd4335b802d66af7 (patch)
tree9574f1f4981ee7e164b7e586e4f85a3a36afa2e4 /bus/apparmor.h
parentad209bd0904e01586bf4e540efd5efa4ea99e2ff (diff)
downloaddbus-d9a2fdb96adf18d6876406a6cd4335b802d66af7.tar.gz
Mediation of processes sending and receiving messages
When an AppArmor confined process wants to send or receive a message, a check is performed to see if the action should be allowed. When a message is going through dbus-daemon, there are two checks performed at once. One for the sending process and one for the receiving process. The checks are based on the process's label, the bus type, destination, path, interface, and member, as well as the peer's label and/or destination name. This allows for the traditional connection-based enforcement, as well as any fine-grained filtering desired by the system administrator. It is important to note that error and method_return messages are allowed to cut down on the amount of rules needed. If a process was allowed to send a message, it can receive error and method_return messages. An example AppArmor rule that would be needed to allow a process to call the UpdateActivationEnvironment method of the session bus itself would be: dbus send bus=session path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=UpdateActivationEnvironment peer=(name=org.freedesktop.DBus), To receive any message on the system bus from a process confined by the "confined-client" AppArmor profile: dbus receive bus=system peer=(label=confined-client), Bug: https://bugs.freedesktop.org/show_bug.cgi?id=75113 Signed-off-by: John Johansen <john.johansen@canonical.com> [tyhicks: Use BusAppArmorConfinement, bug fixes, cleanup, commit msg] [tyhicks: Pass the message type to the AppArmor hook] [tyhicks: Don't audit unrequested reply message denials] Signed-off-by: Tyler Hicks <tyhicks@canonical.com> [smcv: when AA denies sending, don't label requested_reply as "matched rules"] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Tyler Hicks <tyhicks@canonical.com>
Diffstat (limited to 'bus/apparmor.h')
-rw-r--r--bus/apparmor.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/bus/apparmor.h b/bus/apparmor.h
index 4f57c8b3..3f3d6469 100644
--- a/bus/apparmor.h
+++ b/bus/apparmor.h
@@ -46,5 +46,17 @@ dbus_bool_t bus_apparmor_allows_acquire_service (DBusConnection *connection,
const char *bustype,
const char *service_name,
DBusError *error);
+dbus_bool_t bus_apparmor_allows_send (DBusConnection *sender,
+ DBusConnection *proposed_recipient,
+ dbus_bool_t requested_reply,
+ const char *bustype,
+ int msgtype,
+ const char *path,
+ const char *interface,
+ const char *member,
+ const char *error_name,
+ const char *destination,
+ const char *source,
+ DBusError *error);
#endif /* BUS_APPARMOR_H */