Install rear Package
An XCCDF Rule
Description
The rear
package can be installed with the following command:
$ sudo yum install rear
Rationale
rear
contains the Relax-and-Recover (ReaR) utility. ReaR produces a bootable
image of a system and restores from backup using this image.
- ID
- xccdf_org.ssgproject.content_rule_package_rear_installed
- Severity
- Medium
- Updated
Remediation - Anaconda Pre-Install Instructions
package --add=rear
Remediation - OS Build Blueprint
[[packages]]
name = "rear"
version = "*"
Remediation - Ansible
- name: Ensure rear is installed
package:
name: rear
state: present
when: not ( ( ( ansible_architecture == "aarch64" and ansible_distribution == 'OracleLinux'
and ansible_distribution_version is version('9.0', '>=') ) or ( ansible_architecture
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if ! ( ( ( grep -q aarch64 /proc/sys/kernel/osrelease && grep -qP "^ID=[\"']?ol[\"']?$" "/etc/os-release" && { real="$(grep -P "^VERSION_ID=[\"']?[\w.]+[\"']?$" /etc/os-release | sed "s/^VERSION_ID=[\"']\?\([^\"']\+\)[\"']\?$/\1/")"; expected="9.0"; printf "%s\n%s" "$expected" "$real" | sort -VC; } ) || ( grep -q aarch64 /proc/sys/kernel/osrelease && grep -qP "^ID=[\"']?rhel[\"']?$" "/etc/os-release" && { real="$(grep -P "^VERSION_ID=[\"']?[\w.]+[\"']?$" /etc/os-release | sed "s/^VERSION_ID=[\"']\?\([^\"']\+\)[\"']\?$/\1/")"; expected="9.0"; printf "%s\n%s" "$expected" "$real" | sort -VC; } ) || ( grep -qP "^ID=[\"']?rhel[\"']?$" "/etc/os-release" && { real="$(grep -P "^VERSION_ID=[\"']?[\w.]+[\"']?$" /etc/os-release | sed "s/^VERSION_ID=[\"']\?\([^\"']\+\)[\"']\?$/\1/")"; expected="8.4"; printf "%s\n%s" "$real" "$expected" | sort -VC; } && grep -q s390x /proc/sys/kernel/osrelease ) ) ); then
if ! rpm -q --quiet "rear" ; then
yum install -y "rear"
fi
Remediation - Puppet
include install_rear
class install_rear {
package { 'rear':
ensure => 'installed',
}