All Projects → voxpupuli → Puppet Selinux

voxpupuli / Puppet Selinux

Licence: apache-2.0
Puppet Module to manage SELinux on RHEL machines

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Puppet Selinux

Puppet Php
Generic Puppet module to manage PHP on many platforms
Stars: ✭ 83 (+62.75%)
Mutual labels:  hacktoberfest, puppet
Puppet Rabbitmq
RabbitMQ Puppet Module
Stars: ✭ 170 (+233.33%)
Mutual labels:  hacktoberfest, puppet
Puppet Mongodb
mongodb installation
Stars: ✭ 90 (+76.47%)
Mutual labels:  hacktoberfest, puppet
Puppet System
Manage Linux system resources and services from hiera configuration
Stars: ✭ 65 (+27.45%)
Mutual labels:  hacktoberfest, puppet
Puppet Nginx
Puppet Module to manage NGINX on various UNIXes
Stars: ✭ 462 (+805.88%)
Mutual labels:  hacktoberfest, puppet
Jenkins Infra
Jenkins main control repo for R10k and our Puppet Enterprise managed infrastructure
Stars: ✭ 76 (+49.02%)
Mutual labels:  hacktoberfest, puppet
Puppet Mcollective
MCollective Server and Client Puppet Module
Stars: ✭ 121 (+137.25%)
Mutual labels:  hacktoberfest, puppet
Puppet Gitlab
Puppet module to manage Gitlab (Omnibus)
Stars: ✭ 73 (+43.14%)
Mutual labels:  hacktoberfest, puppet
Katello
Katello integrates open source systems management tools into a single solution for controlling the lifecycle of your machines.
Stars: ✭ 312 (+511.76%)
Mutual labels:  hacktoberfest, puppet
Puppet Jenkins
Puppet module for Jenkins
Stars: ✭ 280 (+449.02%)
Mutual labels:  hacktoberfest, puppet
Puppet Filebeat
Stars: ✭ 54 (+5.88%)
Mutual labels:  hacktoberfest, puppet
Puppet Redis
Puppet Module to manage Redis
Stars: ✭ 37 (-27.45%)
Mutual labels:  hacktoberfest, puppet
Puppet R10k
Setup and configure r10k for use with git based environments in puppet
Stars: ✭ 95 (+86.27%)
Mutual labels:  hacktoberfest, puppet
Puppet Python
Puppet module for installing and managing Python, pip, virtualenvs and Gunicorn virtual hosts.
Stars: ✭ 202 (+296.08%)
Mutual labels:  hacktoberfest, puppet
Puppet Confluence
A puppet module to install confluence
Stars: ✭ 18 (-64.71%)
Mutual labels:  hacktoberfest, puppet
Puppet Staging
⛔️ Deprecated in favor of puppet-archive
Stars: ✭ 50 (-1.96%)
Mutual labels:  hacktoberfest, puppet
Cloudsplaining
Cloudsplaining is an AWS IAM Security Assessment tool that identifies violations of least privilege and generates a risk-prioritized report.
Stars: ✭ 1,057 (+1972.55%)
Mutual labels:  hacktoberfest
Ts Postgres
Non-blocking PostgreSQL client for Node.js written in TypeScript.
Stars: ✭ 51 (+0%)
Mutual labels:  hacktoberfest
Redux Query
A library for managing network state in Redux
Stars: ✭ 1,055 (+1968.63%)
Mutual labels:  hacktoberfest
Synfig
This is the Official source code repository of the Synfig project
Stars: ✭ 1,056 (+1970.59%)
Mutual labels:  hacktoberfest

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.

Requirements

  • Puppet 5 or later

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

  • Previously, module building always used the refpolicy framework. The default module builder is now 'simple', which uses only checkmodule. Not all features are supported with this builder.

    To build modules using the refpolicy framework like previous versions did, specify the 'refpolicy' builder either explicitly per module or globally via the main class

  • The interfaces to the various helper manifests has been changed to be more in line with Puppet file resource naming conventions.

    You will need to update your manifests to use the new parameter names.

  • The selinux::restorecond manifest to manage the restorecond service no longer exists

Known problems / limitations

  • If SELinux is disabled and you want to switch to permissive or enforcing you are required to reboot the system (limitation of SELinux). The module won't do this for you.
  • If SELinux is disabled and the user wants enforcing mode, the module will downgrade to permissive mode instead to avoid transitioning directly from disabled to enforcing state after a reboot and potentially breaking the system. The user will receive a warning when this happens,
  • If you add filecontexts with semanage fcontext (what selinux::fcontext does) the order is important. If you add /my/folder before /my/folder/subfolder only /my/folder will match (limitation of SELinux). There is no such limitation to file-contexts defined in SELinux modules. (GH-121)
  • If you try to remove a built-in permissive type, the operation will appear to succeed but will actually have no effect, making your puppet runs non-idempotent.
  • The selinux_port provider may misbehave if the title does not correspond to the format it expects. Users should use the selinux::port define instead except when purging resources
  • Defining port ranges that overlap with existing ranges is currently not detected, and will cause semanage to error when the resource is applied.
  • On Debian systems, the defined types fcontext, permissive, and port do not work because of PA-2985.

Usage

Generated puppet strings documentation with examples is available in the REFERENCE.md

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

Reference

Basic usage

include 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

class { selinux:
  mode => 'enforcing',
  type => '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

selinux::module { 'resnet-puppet':
  ensure    => 'present',
  source_te => 'puppet:///modules/site_puppet/site-puppet.te',
  source_fc => 'puppet:///modules/site_puppet/site-puppet.fc',
  source_if => 'puppet:///modules/site_puppet/site-puppet.if',
  builder   => 'refpolicy'
}

Using pre-compiled policy packages

selinux::module { 'resnet-puppet':
  ensure    => 'present',
  source_pp => 'puppet:///modules/site_puppet/site-puppet.pp',
}

Note that pre-compiled policy packages may not work reliably across all RHEL / CentOS releases. It's up to you as the user to test that your packages load properly.

Set a boolean value

selinux::boolean { 'puppetagent_manage_all_files': }

Defined Types

  • boolean - Set seboolean values
  • fcontext - Define fcontext types and equals values
  • module - Manage an SELinux module
  • permissive - Set a context to permissive.
  • port - Set selinux port context policies

Development

Things to remember

  • The SELinux tools behave odd when SELinux is disabled
    • semanage requires --noreload while in disabled mode when adding or changing something
    • Only few --list operations work
  • run acceptance tests: ./test-acceptance-with-vagrant

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].