Ensure rsyslog is Installed
An XCCDF Rule
Description
Rsyslog is installed by default. Thersyslog
package can be installed with the following command: $ apt-get install rsyslog
Rationale
The rsyslog package provides the rsyslog daemon, which provides system logging services.
- ID
- xccdf_org.ssgproject.content_rule_package_rsyslog_installed
- Severity
- Medium
- References
- Updated
Remediation Templates
OS Build Blueprint
[[packages]]
name = "rsyslog"
version = "*"
An Ansible Snippet
- name: Ensure rsyslog is installed
package:
name: rsyslog
state: present
when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
tags:
A Puppet Snippet
include install_rsyslog
class install_rsyslog {
package { 'rsyslog':
ensure => 'installed',
}
}
A Shell Script
# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
DEBIAN_FRONTEND=noninteractive apt-get install -y "rsyslog"
else
>&2 echo 'Remediation is not applicable, nothing was done'
fi