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 - Ansible

- name: Disable named Service - Collect systemd Services Present in the System
  ansible.builtin.command: systemctl -q list-unit-files --type service
  register: service_exists
  changed_when: false
  failed_when: service_exists.rc not in [0, 1]
  check_mode: false

Remediation - Puppet

include disable_named

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

Remediation - OS Build Blueprint


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