Skip to content

Disable the CUPS Service

An XCCDF Rule

Description

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

Rationale

Turn off unneeded services to reduce attack surface.

ID
xccdf_org.ssgproject.content_rule_service_cups_disabled
Severity
Unknown
References
Updated

Remediation Templates

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 'cups.service'
"$SYSTEMCTL_EXEC" disable 'cups.service'
"$SYSTEMCTL_EXEC" mask 'cups.service'

A Kubernetes Patch

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

OS Build Blueprint

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

An Ansible Snippet

- name: Block Disable service cups
  block:
  - name: Disable service cups
    block:

    - name: Disable service cups

A Puppet Snippet

include disable_cups
class disable_cups {
  service {'cups':
    enable => false,
    ensure => 'stopped',
  }
}