Skip to content

Install libselinux Package

An XCCDF Rule

Description

The libselinux package can be installed with the following command:
$ sudo dnf install libselinux

Rationale

Security-enhanced Linux is a feature of the Linux kernel and a number of utilities with enhanced security functionality designed to add mandatory access controls to Linux. The libselinux package contains the core library of the Security-enhanced Linux system.

ID
xccdf_org.ssgproject.content_rule_package_libselinux_installed
Severity
High
References
Updated

Remediation Templates

Anaconda Pre-Install Instructions

package --add=libselinux

A Puppet Snippet

include install_libselinux
class install_libselinux {
  package { 'libselinux':
    ensure => 'installed',
  }
}

OS Build Blueprint

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

script:kickstart

package install libselinux

An Ansible Snippet

- name: Ensure libselinux is installed
  package:
    name: libselinux
    state: present
  when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
  tags:

A Shell Script

# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
if ! rpm -q --quiet "libselinux" ; then
    dnf install -y "libselinux"
fi