SelinuxConfig - file /etc/selinux/config

class insights.parsers.selinux_config.SelinuxConfig(context)[source]

Bases: insights.core.Parser, insights.core.LegacyItemAccess

Parse the SELinux configuration file.

Produces a simple dictionary of keys and values from the configuration file contents , stored in the data attribute. The object also functions as a dictionary itself thanks to the insights.core.LegacyItemAccess mixin class.

Sample configuration file:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.


>>> conf = shared[SelinuxConfig]
>>> conf['SELINUX']
>>> 'AUTORELABEL' in conf

This method must be implemented by classes based on this class.