Skip to content

Enable rsyslog Service

An XCCDF Rule

Description

The rsyslog service provides syslog-style logging by default on Ubuntu 20.04. The rsyslog service can be enabled with the following command:
$ sudo systemctl enable rsyslog.service

Rationale

The rsyslog service must be running in order to provide logging services, which are essential to system administration.

ID
xccdf_org.ssgproject.content_rule_service_rsyslog_enabled
Severity
Medium
References
Updated

Remediation Templates

OS Build Blueprint

[customizations.services]
enabled = ["rsyslog"]

A Puppet Snippet

include enable_rsyslog
class enable_rsyslog {
  service {'rsyslog':
    enable => true,
    ensure => 'running',
  }
}

An Ansible Snippet

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - DISA-STIG-UBTU-20-010432
  - NIST-800-53-AU-4(1)

A Shell Script

# Remediation is applicable only in certain platforms
if dpkg-query --show --showformat='${db:Status-Status}
' 'kernel' 2>/dev/null | grep -q installed; then
SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" unmask 'rsyslog.service'
"$SYSTEMCTL_EXEC" start 'rsyslog.service'