Disable D-Bus IPC Service (messagebus)
An XCCDF Rule
Description
D-Bus provides an IPC mechanism used by a growing list of programs, such as
those used for Gnome, Bluetooth, and Avahi. Due to these dependencies,
disabling D-Bus may not be practical for many systems.
The messagebus
service can be disabled with the following command:
$ sudo systemctl mask --now messagebus.service
Rationale
If no services which require D-Bus are needed, then it can be disabled. As a broker for IPC between processes of different privilege levels, it could be a target for attack. However, disabling D-Bus is likely to be impractical for any system which needs to provide a graphical login session.
- ID
- xccdf_org.ssgproject.content_rule_service_messagebus_disabled
- Severity
- Low
- References
- Updated
Remediation - Kubernetes Patch
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
spec:
config:
ignition:
version: 3.1.0
Remediation - OS Build Blueprint
[customizations.services]
disabled = ["messagebus"]
Remediation - Ansible
- name: Block Disable service messagebus
block:
- name: Disable service messagebus
block:
Remediation - Puppet
include disable_messagebus
class disable_messagebus {
service {'messagebus':
enable => false,
ensure => 'stopped',
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" stop 'messagebus.service'
"$SYSTEMCTL_EXEC" disable 'messagebus.service'