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

OS Build Blueprint

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

A Kubernetes Patch

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

A Puppet Snippet

include disable_cpupower
class disable_cpupower {
  service {'cpupower':
    enable => false,
    ensure => 'stopped',
  }
}

script:kickstart

service disable cpupower

An Ansible Snippet

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

A Shell Script

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