Disable Control Group Config (cgconfig)
An XCCDF Rule
Description
Control groups allow an administrator to allocate system resources (such as CPU, memory, network bandwidth, etc) among a defined group (or groups) of processes executing on a system. Thecgconfig
daemon starts at boot and establishes the predefined control groups.
The cgconfig
service can be disabled with the following command:
$ sudo systemctl mask --now cgconfig.service
Rationale
Unless control groups are used to manage system resources, running the cgconfig service is not necessary.
- ID
- xccdf_org.ssgproject.content_rule_service_cgconfig_disabled
- Severity
- Low
- References
- Updated
Remediation Templates
A Kubernetes Patch
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
spec:
config:
ignition:
version: 3.1.0
OS Build Blueprint
[customizations.services]
disabled = ["cgconfig"]
A Puppet Snippet
include disable_cgconfig
class disable_cgconfig {
service {'cgconfig':
enable => false,
ensure => 'stopped',
}
}
An Ansible Snippet
- name: Block Disable service cgconfig
block:
- name: Disable service cgconfig
block:
- name: Disable service cgconfig
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 'cgconfig.service'
"$SYSTEMCTL_EXEC" disable 'cgconfig.service'
"$SYSTEMCTL_EXEC" mask 'cgconfig.service'