Skip to content

Ensure logrotate is Installed

An XCCDF Rule

Description

logrotate is installed by default. The logrotate package can be installed with the following command:
 $ sudo zypper install logrotate

Rationale

The logrotate package provides the logrotate services.

ID
xccdf_org.ssgproject.content_rule_package_logrotate_installed
Severity
Medium
References
Updated

Remediation Templates

A Puppet Snippet

include install_logrotate
class install_logrotate {
  package { 'logrotate':
    ensure => 'installed',
  }
}

An Ansible Snippet

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

OS Build Blueprint

[[packages]]
name = "logrotate"
version = "*"

A Shell Script

# Remediation is applicable only in certain platforms
if rpm --quiet -q kernel-default; then
zypper install -y "logrotate"

else
    >&2 echo 'Remediation is not applicable, nothing was done'
fi