Skip to content

Disable tftp Service

An XCCDF Rule

Description

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

Rationale

Disabling the tftp service ensures the system is not acting as a TFTP server, which does not provide encryption or authentication.

ID
xccdf_org.ssgproject.content_rule_service_tftp_disabled
Severity
High
References
Updated

Remediation Templates

An Ansible Snippet

- name: Block Disable service tftp
  block:
  - name: Disable service tftp
    block:

    - name: Disable service tftp

OS Build Blueprint

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

A Puppet Snippet

include disable_tftp
class disable_tftp {
  service {'tftp':
    enable => false,
    ensure => 'stopped',
  }
}

A Shell Script

# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" stop 'tftp.service'
"$SYSTEMCTL_EXEC" disable 'tftp.service'
"$SYSTEMCTL_EXEC" mask 'tftp.service'

A Kubernetes Patch

apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
spec:
  config:
    ignition:
      version: 3.1.0