voxpupuli/puppet-selinux

Name: puppet-selinux

Owner: Vox Pupuli

Description: Puppet Module to manage SELinux on RHEL machines

Created: 2011-11-17 21:47:08.0

Updated: 2017-11-09 23:28:11.0

Pushed: 2018-01-11 08:00:32.0

Homepage: https://forge.puppet.com/puppet/selinux

Size: 564

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

SELinux module for Puppet

Build Status Code Coverage Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores

Table of Contents
  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Defined Types
  6. Development - Guide for contributing to the module
  7. Authors
Overview

This class manages SELinux on RHEL based systems.

Requirements
Module Description

This module will configure SELinux and/or deploy SELinux based modules to running system.

Get in touch
Upgrading from puppet-selinux 0.8.x
Known problems / limitations
Usage

Generated puppet strings documentation with examples is available from https://voxpupuli.org/puppet-selinux/

It's also included in the docs/ folder as simple html pages.

Reference
Basic usage
ude selinux

This will include the module and allow you to use the provided defined types, but will not modify existing SELinux settings on the system.

More advanced usage
s { selinux:
de => 'enforcing',
pe => 'targeted',

This will include the module and manage the SELinux mode (possible values are enforcing, permissive, and disabled) and enforcement type (possible values are targeted, minimum, and mls). Note that disabling SELinux requires a reboot to fully take effect. It will run in permissive mode until then.

Deploy a custom module using the refpolicy framework
nux::module { 'resnet-puppet':
sure    => 'present',
urce_te => 'puppet:///modules/site_puppet/site-puppet.te',
urce_fc => 'puppet:///modules/site_puppet/site-puppet.fc',
urce_if => 'puppet:///modules/site_puppet/site-puppet.if',
ilder   => 'refpolicy'

Set a boolean value
nux::boolean { 'puppetagent_manage_all_files': }
Defined Types
Development
Things to remember
ER_debug=yes BEAKER_set="centos-6-x64" PUPPET_INSTALL_TYPE="agent" bundle exec rake beaker &&
ER_debug=yes BEAKER_set="centos-7-x64" PUPPET_INSTALL_TYPE="agent" bundle exec rake beaker &&
ER_debug=yes BEAKER_set="fedora-25-x64" PUPPET_INSTALL_TYPE="agent" bundle exec rake beaker &&
ER_debug=yes BEAKER_set="fedora-26-x64" PUPPET_INSTALL_TYPE="agent" bundle exec rake beaker &&
ER_debug=yes BEAKER_set="fedora-27-x64" PUPPET_INSTALL_TYPE="agent" bundle exec rake beaker
Facter facts

The fact values might be unexpected while in disabled mode. One could expect the config_mode to be set, but only the boolean enabled is set.

The most important facts:

| Fact | Fact (old) | Mode: disabled | Mode: permissive | Mode: enforcing | |——————————————-|—————————|—————-|—————————————–|—————————————–| | $facts['os']['selinux']['enabled'] | $::selinux | false | true | true | | $facts['os']['selinux'['config_mode'] | $::selinux_config_mode | undef | Value of SELINUX in /etc/selinux/config | Value of SELINUX in /etc/selinux/config | | $facts['os']['selinux']['current_mode'] | $::selinux_current_mode | undef | Value of getenforce downcased | Value of getenforce downcased |

Authors

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.