Skip to content

Disable Control Group Rules Engine (cgred)

An XCCDF Rule

Description

The cgred service moves tasks into control groups according to parameters set in the /etc/cgrules.conf configuration file. The cgred service can be disabled with the following command:

$ sudo systemctl mask --now cgred.service

Rationale

Unless control groups are used to manage system resources, running the cgred service service is not necessary.

ID
xccdf_org.ssgproject.content_rule_service_cgred_disabled
Severity
Low
References
Updated



Remediation - OS Build Blueprint


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

Remediation - Shell Script

# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then

SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" stop 'cgred.service'
"$SYSTEMCTL_EXEC" disable 'cgred.service'

Remediation - Kubernetes Patch

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

Remediation - Ansible

- name: Block Disable service cgred
  block:

  - name: Disable service cgred
    block:


Remediation - Puppet

include disable_cgred

class disable_cgred {
  service {'cgred':
    enable => false,
    ensure => 'stopped',