Skip to content

2.1.2 Ensure avahi daemon services are not in use

Audit#

Run the following command to verify avahi-daemon is not installed:

# dpkg-query -s avahi-daemon &>/dev/null && echo "avahi-daemon is installed"
Nothing should be returned.

- OR - - IF - the avahi package is required as a dependency: Run the following command to verify avahi-daemon.socket and avahi-daemon.service are not enabled:

# systemctl is-enabled avahi-daemon.socket avahi-daemon.service 2>/dev/null | grep 'enabled'
Nothing should be returned.

Run the following command to verify avahi-daemon.socket and avahi-daemon.service are not active:

# systemctl is-active avahi-daemon.socket avahi-daemon.service 2>/dev/null | grep '^active
Nothing should be returned.

Note: If the package is required for a dependency - Ensure the dependent package is approved by local site policy - Ensure stopping and masking the service and/or socket meets local site policy

Remediation#

Run the following commands to stop avahi-daemon.socket and avahi-daemon.service, and remove the avahi-daemon package:

# systemctl stop avahi-daemon.socket avahi-daemon.service
# apt purge avahi-daemon

- OR - - IF - the avahi-daemon package is required as a dependency: Run the following commands to stop and mask avahi-daemon.socket and avahi-daemon.service:

# systemctl stop avahi-daemon.socket avahi-daemon.service
# systemctl mask avahi-daemon.socket avahi-daemon.service