2.2.5 Ensure dnsmasq services are not in use

Information

dnsmasq is a lightweight tool that provides DNS caching, DNS forwarding and DHCP (Dynamic Host Configuration Protocol) services.

Unless a system is specifically designated to act as a DNS caching, DNS forwarding and/or DHCP server, it is recommended that the package be removed to reduce the potential attack surface.

Solution

Run the following commands to stop dnsmasq.service and remove dnsmasq package:

# systemctl stop dnsmasq.service
# dnf remove dnsmasq

-OR-

-IF- the dnsmasq package is required as a dependency:

Run the following commands to stop and mask the dnsmasq.service :

# systemctl stop dnsmasq.service
# systemctl mask dnsmasq.service

Impact:

There may be packages that are dependent on the dnsmasq package. If the dnsmasq package is removed, these dependent packages will be removed as well. Before removing the dnsmasq package, review any dependent packages to determine if they are required on the system.

-IF- a dependent package is required: stop and mask the dnsmasq.service leaving the dnsmasq package installed.

See Also

https://workbench.cisecurity.org/benchmarks/15287

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-6, 800-53|CM-7, CSCv7|9.2

Plugin: Unix

Control ID: 03f9042a8a7e5d7a9ebf0e3fb15bca585451e7841e2a1838e2aaa93b798adb44