Skip to content

Disable named Service

An XCCDF Rule

Description

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

Rationale

All network services involve some risk of compromise due to implementation flaws and should be disabled if possible.

ID
xccdf_org.ssgproject.content_rule_service_named_disabled
Severity
Medium
References
Updated

Remediation Templates

A Puppet Snippet

include disable_named
class disable_named {
  service {'named':
    enable => false,
    ensure => 'stopped',
  }
}

OS Build Blueprint

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

An Ansible Snippet

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - CCE-92245-0
  - NIST-800-53-CM-6(a)

A Shell Script

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