Skip to content

Disable CPU Speed (cpupower)

An XCCDF Rule

Description

The cpupower service can adjust the clock speed of supported CPUs based upon the current processing load thereby conserving power and reducing heat. The cpupower service can be disabled with the following command:
$ sudo systemctl mask --now cpupower.service

Rationale

The cpupower service is only necessary if adjusting the CPU clock speed provides benefit. Traditionally this has included laptops (to enhance battery life), but may also apply to server or desktop environments where conserving power is highly desirable or necessary.

ID
xccdf_org.ssgproject.content_rule_service_cpupower_disabled
Severity
Low
References
Updated

Remediation Templates

An Ansible Snippet

- name: Block Disable service cpupower
  block:
  - name: Disable service cpupower
    block:

    - name: Disable service cpupower

A Kubernetes Patch

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

OS Build Blueprint

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

A Puppet Snippet

include disable_cpupower
class disable_cpupower {
  service {'cpupower':
    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 'cpupower.service'
"$SYSTEMCTL_EXEC" disable 'cpupower.service'
"$SYSTEMCTL_EXEC" mask 'cpupower.service'