Skip to content

Uninstall DHCP Server Package

An XCCDF Rule

Description

If the system does not need to act as a DHCP server, the dhcp package can be uninstalled. The dhcp package can be removed with the following command:

$ sudo yum erase dhcp

Rationale

Removing the DHCP server ensures that it cannot be easily or accidentally reactivated and disrupt network operation.

ID
xccdf_org.ssgproject.content_rule_package_dhcp_removed
Severity
Medium
References
Updated



Remediation - Puppet

include remove_dhcp

class remove_dhcp {
  package { 'dhcp':
    ensure => 'purged',
  }

Remediation - Anaconda Pre-Install Instructions


package --remove=dhcp

Remediation - Ansible

- name: Ensure dhcp is removed
  package:
    name: dhcp
    state: absent
  tags:
  - CCE-80331-2

Remediation - Shell Script


# CAUTION: This remediation script will remove dhcp
#	   from the system, and may remove any packages
#	   that depend on dhcp. Execute this
#	   remediation AFTER testing on a non-production
#	   system!