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 - OS Build Blueprint


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

Remediation - Puppet

include disable_xinetd

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

Remediation - Shell Script

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

SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" stop 'xinetd.service'
"$SYSTEMCTL_EXEC" disable 'xinetd.service'

Remediation - Ansible

- name: Block Disable service xinetd
  block:

  - name: Disable service xinetd
    block: