system.conf 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <!-- This configuration file controls the systemwide message bus.
  2. Add a system-local.conf and edit that rather than changing this
  3. file directly. -->
  4. <!-- Note that there are any number of ways you can hose yourself
  5. security-wise by screwing up this file; in particular, you
  6. probably don't want to listen on any more addresses, add any more
  7. auth mechanisms, run as a different user, etc. -->
  8. <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
  9. "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
  10. <busconfig>
  11. <!-- Our well-known bus type, do not change this -->
  12. <type>system</type>
  13. <!-- Run as special user -->
  14. <user>messagebus</user>
  15. <!-- Fork into daemon mode -->
  16. <fork/>
  17. <!-- We use system service launching using a helper -->
  18. <standard_system_servicedirs/>
  19. <!-- This is a setuid helper that is used to launch system services -->
  20. <servicehelper>/usr/libexec/dbus-daemon-launch-helper</servicehelper>
  21. <!-- Write a pid file -->
  22. <pidfile>/var/run/messagebus.pid</pidfile>
  23. <!-- Enable logging to syslog -->
  24. <syslog/>
  25. <!-- Only allow socket-credentials-based authentication -->
  26. <auth>EXTERNAL</auth>
  27. <!-- Only listen on a local socket. (abstract=/path/to/socket
  28. means use abstract namespace, don't really create filesystem
  29. file; only Linux supports this. Use path=/whatever on other
  30. systems.) -->
  31. <listen>unix:path=/var/run/dbus/system_bus_socket</listen>
  32. <policy context="default">
  33. <!-- All users can connect to system bus -->
  34. <allow user="*"/>
  35. <!-- Holes must be punched in service configuration files for
  36. name ownership and sending method calls -->
  37. <deny own="*"/>
  38. <deny send_type="method_call"/>
  39. <!-- Signals and reply messages (method returns, errors) are allowed
  40. by default -->
  41. <allow send_type="signal"/>
  42. <allow send_requested_reply="true" send_type="method_return"/>
  43. <allow send_requested_reply="true" send_type="error"/>
  44. <!-- All messages may be received by default -->
  45. <allow receive_type="method_call"/>
  46. <allow receive_type="method_return"/>
  47. <allow receive_type="error"/>
  48. <allow receive_type="signal"/>
  49. <!-- Allow anyone to talk to the message bus -->
  50. <allow send_destination="org.freedesktop.DBus"
  51. send_interface="org.freedesktop.DBus" />
  52. <allow send_destination="org.freedesktop.DBus"
  53. send_interface="org.freedesktop.DBus.Introspectable"/>
  54. <!-- But disallow some specific bus services -->
  55. <deny send_destination="org.freedesktop.DBus"
  56. send_interface="org.freedesktop.DBus"
  57. send_member="UpdateActivationEnvironment"/>
  58. <deny send_destination="org.freedesktop.DBus"
  59. send_interface="org.freedesktop.DBus.Debug.Stats"/>
  60. <deny send_destination="org.freedesktop.DBus"
  61. send_interface="org.freedesktop.systemd1.Activator"/>
  62. </policy>
  63. <!-- Only systemd, which runs as root, may report activation failures. -->
  64. <policy user="root">
  65. <allow send_destination="org.freedesktop.DBus"
  66. send_interface="org.freedesktop.systemd1.Activator"/>
  67. </policy>
  68. <!-- root may monitor the system bus. -->
  69. <policy user="root">
  70. <allow send_destination="org.freedesktop.DBus"
  71. send_interface="org.freedesktop.DBus.Monitoring"/>
  72. </policy>
  73. <!-- If the Stats interface was enabled at compile-time, root may use it.
  74. Copy this into system.local.conf or system.d/*.conf if you want to
  75. enable other privileged users to view statistics and debug info -->
  76. <policy user="root">
  77. <allow send_destination="org.freedesktop.DBus"
  78. send_interface="org.freedesktop.DBus.Debug.Stats"/>
  79. </policy>
  80. <!-- Include legacy configuration location -->
  81. <include ignore_missing="yes">/etc/dbus-1/system.conf</include>
  82. <!-- Config files are placed here that among other things, punch
  83. holes in the above policy for specific services. -->
  84. <includedir>system.d</includedir>
  85. <includedir>/etc/dbus-1/system.d</includedir>
  86. <!-- This is included last so local configuration can override what's
  87. in this standard file -->
  88. <include ignore_missing="yes">/etc/dbus-1/system-local.conf</include>
  89. <include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include>
  90. </busconfig>