Skip to content

Disable xinetd Service

An XCCDF Rule

Description

The xinetd service can be disabled with the following command:
$ sudo systemctl mask --now xinetd.service

Rationale

The xinetd service provides a dedicated listener service for some programs, which is no longer necessary for commonly-used network services. Disabling it ensures that these uncommon services are not running, and also prevents attacks against xinetd itself.

ID
xccdf_org.ssgproject.content_rule_service_xinetd_disabled
Severity
Medium
References
Updated

Remediation Templates

A Puppet Snippet

include disable_xinetd
class disable_xinetd {
  service {'xinetd':
    enable => false,
    ensure => 'stopped',
  }
}

OS Build Blueprint

[customizations.services]
masked = ["xinetd"]

An Ansible Snippet

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - NIST-800-171-3.4.7
  - NIST-800-53-CM-6(a)

A Shell Script

# Remediation is applicable only in certain platforms
if rpm --quiet -q kernel; then
SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" stop 'xinetd.service'
"$SYSTEMCTL_EXEC" disable 'xinetd.service'
"$SYSTEMCTL_EXEC" mask 'xinetd.service'