selinux

manages the SELinux system state

18,232 downloads

112 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 2.13.0 (latest)
  • 2.12.0
  • 2.11.0
  • 2.9.0
  • 2.8.0
  • 2.7.0
  • 2.6.3
  • 2.6.2
  • 2.6.1
  • 2.6.0
  • 2.5.1
  • 2.5.0
  • 2.4.1
  • 2.4.0
  • 2.3.1
  • 2.3.0
  • 2.2.0
  • 2.1.2
  • 2.1.1
  • 2.1.0
  • 2.0.2
  • 1.0.4
  • 1.0.3
released Sep 16th 2024
This version is compatible with:
  • Puppet Enterprise 2025.2.x, 2025.1.x, 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
  • Puppet >= 7.0.0 < 9.0.0
  • , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'simp-selinux', '2.13.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add simp-selinux
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install simp-selinux --version 2.13.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

simp/selinux — version 2.13.0 Sep 16th 2024

Reference

Table of Contents

Classes

Resource types

  • selinux_login: Manage SELinux login mapping configuration NOTE: You may need to run restorecon -RF on any user home directories that have their default c
  • selinux_state: Toggle the enforcement of selinux

Data types

Classes

selinux

The selinux class.

Parameters

The following parameters are available in the selinux class:

package_ensure

Data type: String

The ensure status of packages to be installed

Default value: simplib::lookup('simp_options::package_ensure', { 'default_value' => 'present' })

login_resources

Data type: Optional[Hash]

A hash of resources that should be created on the system as expected by create_resources() called on the selinux_login type

A deep merge strategy is used when performing APL lookups on this value by default.

@example Change default to user_u


selinux::login_resources: "default": seuser: user_u mls_range: s0 "%admins": seuser: staff_u

  # This only works if you enable mcstransd
  # using selinux::manage_mcstrans_service: true
  mls_range: "SystemLow-SystemHigh"

Default value: undef

manage_mcstrans_package

Data type: Boolean

manage_mcstrans_service

Data type: Boolean

mcstrans_package_name

Data type: String

mcstrans_service_name

Data type: String

manage_restorecond_package

Data type: Boolean

manage_restorecond_service

Data type: Boolean

restorecond_package_name

Data type: String

ensure

Data type: Selinux::State

Default value: 'enforcing'

kernel_enforce

Data type: Boolean

Default value: false

autorelabel

Data type: Boolean

Default value: false

manage_utils_package

Data type: Boolean

Default value: true

mode

Data type: Enum['targeted','mls']

Default value: 'targeted'

selinux::config

Set global SELinux system parameters

selinux::install

Install selinux-related packages not managed by vox_selinux

Parameters

The following parameters are available in the selinux::install class:

manage_utils_package

Data type: Boolean

Default value: pick(getvar('selinux::manage_utils_package'), true)

utils_packages

Data type: Array[String]

Default value: ['checkpolicy']

manage_mcstrans_package

Data type: Boolean

Default value: simplib::lookup('selinux::manage_mcstrans_package')

mcstrans_package_name

Data type: String

Default value: simplib::lookup('selinux::mcstrans_package_name')

manage_restorecond_package

Data type: Boolean

Default value: simplib::lookup('selinux::manage_restorecond_package')

restorecond_package_name

Data type: String

Default value: simplib::lookup('selinux::restorecond_package_name')

package_ensure

Data type: String

Default value: simplib::lookup('selinux::package_ensure', { 'default_value' => simplib::lookup('simp_options::package_ensure', { 'default_value' => 'present' } ) } )

selinux::service

Ensures mcstrans and restorecond services managed

Resource types

selinux_login

Manage SELinux login mapping configuration

NOTE: You may need to run restorecon -RF on any user home directories that have their default contexts updated. This is particularly important for the __default__ login entry but cannot be automated given the potential load and unintended system consequences.

Properties

The following properties are available in the selinux_login type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

mls_range

Valid values: /^.+$/

The Multi-Level Security range to be applied to the login

seuser

Valid values: /^.+$/

The SELinux user to which the login should be mapped. You can get a list by running semanage user -l

Parameters

The following parameters are available in the selinux_login type.

force

Valid values: true, false, yes, no

Force the modification of potentially unsafe logins such as "root" and "default"

Default value: false

name

namevar

The user or group name to be managed. Groups must be prefixed with a "%"

provider

The specific backend to use for this selinux_login resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

selinux_state

Toggle the enforcement of selinux

Properties

The following properties are available in the selinux_state type.

ensure

Valid values: false, true, disabled, permissive, enforcing

Set the SELinux state on the system

Default value: enforcing

Parameters

The following parameters are available in the selinux_state type.

autorelabel

Valid values: true, false, yes, no

Automatically determine if the filesystem needs to be relabeled. Enforcing > Permissive > Disabled Going to the right requires relabeling.

Default value: true

name

namevar

An arbitrary, but unique, name for the resource.

provider

The specific backend to use for this selinux_state resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

Data types

Selinux::State

Types of selinux enforcement

Alias of

Variant[Boolean, Enum[
    'enforcing',
    'permissive',
    'disabled'
  ]]