Disable System Statistics Reset Service (sysstat)
An XCCDF Rule
Description
The sysstat
service resets various I/O and CPU
performance statistics to zero in order to begin counting from a fresh state
at boot time.
The sysstat
service can be disabled with the following command:
$ sudo systemctl mask --now sysstat.service
Rationale
By default the sysstat
service runs a program at
boot to reset performance statistics. This data can be retrieved using programs such as
sar
and sadc
. While the sysstat
service may provide useful
insight into system operation, through the lens of providing only essential system services,
this service should be disabled.
- ID
- xccdf_org.ssgproject.content_rule_service_sysstat_disabled
- Severity
- Low
- References
- Updated
Remediation - Kubernetes Patch
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
spec:
config:
ignition:
version: 3.1.0
Remediation - OS Build Blueprint
[customizations.services]
disabled = ["sysstat"]
Remediation - Puppet
include disable_sysstat
class disable_sysstat {
service {'sysstat':
enable => false,
ensure => 'stopped',
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 'sysstat.service'
"$SYSTEMCTL_EXEC" disable 'sysstat.service'
Remediation - Ansible
- name: Block Disable service sysstat
block:
- name: Disable service sysstat
block: