Skip to content

Uninstall tcpd Package

An XCCDF Rule

Description

The tcpd package can be removed with the following command:

$ sudo zypper remove tcpd

Rationale

Administrators can use TCP wrapper library and daemon for host control over network services. In these implementations, xinetd runs tcpd program, which first looks at the incomming connection as well as the access control lists in the /etc/hosts.allow and /etc/hosts.deny files. Removing the xinetd package decreases the risk of the xinetd service's accidental (or intentional) activation. The removal of tcpd package will support this protective measure in addition.

ID
xccdf_org.ssgproject.content_rule_package_tcp_wrappers_removed
Severity
Low
References
Updated



Remediation - Ansible

- name: Ensure tcpd is removed
  package:
    name: tcpd
    state: absent
  when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
  tags:

Remediation - Puppet

include remove_tcpd

class remove_tcpd {
  package { 'tcpd':
    ensure => 'purged',
  }

Remediation - Shell Script

# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then

# CAUTION: This remediation script will remove tcpd
#	   from the system, and may remove any packages
#	   that depend on tcpd. Execute this