Documentation by YARD 0.9.9
-Alphabetic Index
- -Puppet Class Listing A-Z
- - -
-
-
-
|
-
File Listing
--
-
-
-
- README - - -
diff --git a/.gitignore b/.gitignore index a9f3c4a..a356406 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# .gitignore for cd_selinux .yardoc Gemfile.lock FileList +.scannerwork diff --git a/.mdl_style.rb b/.mdl_style.rb new file mode 100644 index 0000000..5d4d3b9 --- /dev/null +++ b/.mdl_style.rb @@ -0,0 +1,3 @@ +all +rule 'MD013', :line_length => 1000 +exclude_rule 'MD036' diff --git a/.mdlrc b/.mdlrc new file mode 100644 index 0000000..e5c563a --- /dev/null +++ b/.mdlrc @@ -0,0 +1,2 @@ +style '.mdl_style.rb' + diff --git a/.spelling b/.spelling new file mode 100644 index 0000000..7427418 --- /dev/null +++ b/.spelling @@ -0,0 +1,141 @@ +# markdown-spellcheck spelling configuration file +# Format - lines begining # are comments +# global dictionary is at the start, file overrides afterwards +# one word per line, to define a file override use ' - filename' +# where filename is relative to this configuration file +Readme.md +httpd +sudo +selinux +site.pp +nodes.pp +cd_apache +:: +params +Foreman +cd_resources +CentOS +Puppet +ConfDroid +nagios +vHosts +vHost +phpMyAdmin +phpPgAdmin +parameterized +erb +Confdroid.com +UTF_Files +Elasticsearch +cd_firewall +puppetlabs +cd_elasticsearch +cd_fail2ban +Fail2Ban +intrusion +fail2ban +firewalld +prevention +management +CentOS7 +auto-installed +filebeat +Elastic +installer +Foreman +postgresql +TLS +cd_foreman +install.sh +git +cd_git +Gitlab +gitlab +gitlab-ce +gitlab.rb +psql +setup +service +user +optional +postgresql +database +via +tls +encryption +certbot +cd_postgresql +cd_certbot +cd_gitlab +sourcecode +pg_hba.conf +hiera +cd_tls +ca_chain +config +gitlab-ctl +haproxy +cd_concat +concat +cd_haproxy +haproxy.cfg +fqdn +ACLs +contineous +Jenkinsfiles +Jenkinsfile +SEEDjob +Github +job-dsl +community +providing +API +REGEX +plugins +cd_jenkins +cd_java +cd_nagios +cd_kibana +Kibana +Elastic +Stack +elasticsearch +MySQL +mysql +my.conf +cd_mysql +mysqld +PuppetDB +cd_selinux +cd_nrpe +cd_stdlib +puppetlabs +cd_concat +stdlib +cd_puppetdb +SSL +vhost +nrpe +iptables +NTP +manycast +cd_ntp +remi +repo +cd_php +Cyril +Roundcube +Dovecot +postmap +cd_postfix +pg_hba +pgdata +puppetserver +puppetdb +r10k +cd_puppet +cri +Rsyslog +Linux +Unix +cd_rsyslog diff --git a/Gemfile b/Gemfile index e9584ba..49f82d7 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' puppetversion = ENV.key?('PUPPET_VERSION') ? ENV['PUPPET_VERSION'] : ['<= 5.5.6'] gem 'metadata-json-lint', '~> 2.4' gem 'puppet', puppetversion -gem 'puppetlabs_spec_helper', '>= 1.0.0' +gem 'puppetlabs_spec_helper', '~> 3.0' gem 'puppet-lint' gem 'facter' gem 'rspec-puppet' @@ -15,6 +15,7 @@ gem 'rgen' gem 'public_suffix', '<= 2.0.5' gem 'parallel', '<= 1.13.0' gem 'puppet-syntax', '~> 2.6', '>= 2.6.1' +gem 'pathspec', '~> 0.2.1' # rspec must be v2 for ruby 1.8.7 if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' diff --git a/Jenkinsfile b/Jenkinsfile index c57b684..6760246 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -70,13 +70,35 @@ pipeline { } } - stage('update repo structure') { + stage('markdown-lint') { steps { - sh '''rm -Rf REPOSTRUCTURE.md - echo "$(tree --dirsfirst --charset=ascii .)" > REPOSTRUCTURE.md''' + sh ''' + source /opt/rh/rh-ruby27/enable + mdl README.md + ''' } } + stage('spell check') { + steps { + sh ''' + mdspell -r -n -a "**/*.md" + ''' + } + } + + stage('SonarScan') { + steps { + sh ''' + /opt/sonar-scanner/bin/sonar-scanner \ + -Dsonar.projectKey=cd_selinux \ + -Dsonar.sources=. \ + -Dsonar.host.url=http://sonarqube.confdroid.com \ + -Dsonar.login=f4d68d1f43370b34439eee7fbf5e2b6182cf449c + ''' + } + } + stage('create Puppet documention') { steps { sh '/opt/puppetlabs/bin/puppet strings' diff --git a/README.md b/README.md index 14b1629..d173a38 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,20 @@ +# Readme + [](https://pipelines.confdroid.com/job/cd_selinux/) -### Synopsis -[Security-Enhanced Linux (SELinux) is a Linux kernel security module that provides a mechanism for supporting access control security policies.](https://en.wikipedia.org/wiki/Security-Enhanced_Linux) +[[_TOC_]] + +## Synopsis + +[Security-Enhanced Linux (SELinux)](https://en.wikipedia.org/wiki/Security-Enhanced_Linux) is a Linux kernel security module that provides a mechanism for supporting access control security policies. `cd_selinux` is a Puppet module to automate installation, configuration and troubleshooting of selinux. -### WARNING -`**__!!! Attention: Never use this puppet module on systems which have been previously configured manually. It is impossible to predict how and what would have been configured, hence previuos configurations outside the scope of this module may be overwritten! Automated configurations require a test environment to verify that the module suits the purpose intended by the user, as well as tune the parameters, before deploying into live production!!! __**` +## WARNING -### Table of Contents -* [Features](#features) -* [Repo Structure](https://sourcecode.confdroid.com/12WW1160/cd_selinux/blob/master/REPOSTRUCTURE.md) -* [Dependencies](#dependencies) -* [Deployment](#deployment) - * [native Puppet deployment](#native-puppet-deployment) - * [through Foreman](#through-foreman) -* [Parameters](#parameters) - * [Mandatory Parameters](#mandatory-parameters) - * [Optional Parameters](#optional-parameters) -* [SELINUX](#selinux) -* [Known Problems](#known-problems) -* [Support](#support) -* [Tests](#tests) -* [Contact Us](https://confdroid.com/contact/) -* [Disclaimer](#disclaimer) +***Attention: Never use this puppet module on systems which have been previously configured manually. It is impossible to predict how and what would have been configured, hence previous configurations outside the scope of this module may be overwritten! Automated configurations require a test environment to verify that the module suits the purpose intended by the user, as well as tune the parameters, before deploying into live production*** -### Features +## Features Installation: * install binaries required for selinux and related tools @@ -34,66 +23,68 @@ Configuration * manage /etc/sysconfig/selinux file (file system permissions, selinux context, content) * manage current selinux status (permissive,enforcing) +## Repo Documentation -### Repo Structure -Repostructure has moved to REPOSTRUCTURE.md in repo. +See the full Puppet documentation including parameters in `docs/index.html`. + +## Dependencies -### Dependencies All dependencies must be included in the catalogue. * [cd_resources](https://sourcecode.confdroid.com/12WW1160/cd_resources) for yum repo resources. -### Deployment +## Deployment -##### native Puppet deployment +* native Puppet deployment via site.pp or nodes.pp -``` +```ruby node 'example.example.net' { include cd_selinux } ``` -#### through Foreman: + +* through Foreman: + In order to apply parameters through Foreman, **__cd_selinux::params__** must be added to the host or hostgroup in question. See [more details about class deployment on Confdroid.com](https://confdroid.com/2017/05/deploying-our-puppet-modules/). +## SELINUX -### Parameters -The following parameters are editable via params.pp or through ENC (**__recommended__**). Values changed will take immediate effect at next puppet run. Services will be restarted where neccessary. - -#### Mandatory Parameters - -#### Optional Parameters -* `sx_install_setools` : Whether to install additional selinux tools, i.e. for troubleshooting. -* `sx_selinux_status` : Which selinux status should be configured, sets both the status in the configuration file and on commanbd line. Valid options are `enforcing` and `permissive`. Defaults to `enforcing`. - -### SELINUX All files and directories are configured with correct selinux context. If selinux is disabled, these contexts are ignored. -### Known Problems -* Systems configured with selinux disabled require a reboot for selinux to be enabled. This module will **__not__** do the reboot for you to avoid unexpected outages. +## Known Problems + +* Systems reconfigured with selinux disabled require once a reboot for selinux to be enabled. This module will **__not__** do the reboot for you to avoid unexpected outages. -### Support +## Support + * OS: CentOS 7 -* Puppet 5.x +* Puppet 5,6 +## Tests -### Tests * Puppet Lint * excluded tests: - * `--no-class_inherits_from_params_class-check`:relavant only to non-supported outdated puppet versions + * `--no-class_inherits_from_params_class-check`:relevant only to non-supported outdated puppet versions * `--no-variable_scope-check`: not applicable as we are inheriting parameters from params class. the lint check does not distinguish between facts and inherited parameters. * `--no-80chars-check`: it is not always possible to stay within 80 characters, although typically only occurring on the parameter vault `params.pp`. * `--no-arrow_alignment-check`: this check leads to actually not having am easily readable arrow alignment, as this checks `per block`, not per class. * Puppet Parser * ERB Template Parser -* Test for unwanted UTF8 files in the Puppet code as this causes problems with PuppetDB (see tests/UTF_Files) -### Contact Us +* Test for unwanted UTF8 files in the Puppet code (see tests/UTF_Files) +* Markdown-lint +* Spellcheck +* Sonar Quality Gate + +## Contact Us + [contact Us](https://confdroid.com/contact/) -### Disclaimer +## Disclaimer + ConfDroid as entity is entirely independent from Puppet. We provide custom configuration modules, written for specific purposes and specific environments. The modules are tested and supported only as documented, and require testing in designated environments (i.e. lab or development environments) for parameter tuning etc. before deploying into production environments. diff --git a/REPOSTRUCTURE.md b/REPOSTRUCTURE.md deleted file mode 100644 index e52941a..0000000 --- a/REPOSTRUCTURE.md +++ /dev/null @@ -1,46 +0,0 @@ -. -|-- doc -| |-- css -| | |-- common.css -| | |-- full_list.css -| | `-- style.css -| |-- js -| | |-- app.js -| | |-- full_list.js -| | `-- jquery.js -| |-- puppet_classes -| | |-- cd_selinux_3A_3Adirs.html -| | |-- cd_selinux_3A_3Amain_3A_3Aconfig.html -| | |-- cd_selinux_3A_3Amain_3A_3Adirs.html -| | |-- cd_selinux_3A_3Amain_3A_3Afiles.html -| | |-- cd_selinux_3A_3Amain_3A_3Ainstall.html -| | |-- cd_selinux_3A_3Aparams.html -| | `-- cd_selinux.html -| |-- file.README.html -| |-- frames.html -| |-- _index.html -| |-- index.html -| |-- puppet_class_list.html -| `-- top-level-namespace.html -|-- manifests -| |-- main -| | |-- config.pp -| | |-- dirs.pp -| | |-- files.pp -| | `-- install.pp -| |-- init.pp -| `-- params.pp -|-- templates -| `-- main -| `-- selinux_config.erb -|-- tests -| `-- UTF_Files -|-- CHANGELOG.md -|-- Gemfile -|-- Gemfile.lock -|-- Jenkinsfile -|-- LICENSE -|-- README.md -`-- REPOSTRUCTURE.md - -9 directories, 34 files diff --git a/doc/_index.html b/doc/_index.html deleted file mode 100644 index 2b5c490..0000000 --- a/doc/_index.html +++ /dev/null @@ -1,137 +0,0 @@ - - -
- - -
-
-
-
|
-
| t |
- - - -23 -24 -25- |
-
- # File 'manifests/init.pp', line 23
-
-class cd_selinux {
- include cd_selinux::params
-}
- |
-
cd_selinux::dirs.pp -Module name: cd_selinux -Author: Arne Teuke -(arne_teuke@ConfDroid.com)
- -This file is part of cd_selinux.
- -cd_selinux is used for providing automatic configuration of SELINUX - -Copyright (C) 2016 ConfDroid (copyright@ConfDroid.com) - This program is -free software: you can redistribute it and/or modify - it under the terms of -the GNU General Public License as published by - the Free Software -Foundation, either version 3 of the License, or - (at your option) any later -version.
- -This program is distributed in the hope that it will be useful, - but -WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License -for more details.
- -You should have received a copy of the GNU General Public License - along -with this program. If not, see www.gnu.org/licenses/.
- -
- - - -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40- |
-
- # File 'manifests/main/dirs.pp', line 23
-
-class cd_selinux::dirs (
-
-) inherits cd_selinux::params {
-
- require cd_selinux::main::install
-
- file { $sx_main_dir:
- ensure => directory,
- path => $sx_main_dir,
- owner => 'root',
- group => 'root',
- mode => '0755',
- selrange => s0,
- selrole => object_r,
- seltype => selinux_config_t,
- seluser => system_u,
- }
-}
- |
-
cd_selinux::main::config.pp -Module name: cd_selinux -Author: Arne Teuke -(arne_teuke@ConfDroid.com)
- -This file is part of cd_selinux.
- -cd_selinux is used for providing automatic configuration of SELINUX. - -Copyright (C) 2016 ConfDroid (copyright@ConfDroid.com) - This program is -free software: you can redistribute it and/or modify - it under the terms of -the GNU General Public License as published by - the Free Software -Foundation, either version 3 of the License, or - (at your option) any later -version.
- -This program is distributed in the hope that it will be useful, - but -WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License -for more details.
- -You should have received a copy of the GNU General Public License - along -with this program. If not, see www.gnu.org/licenses/.
- -
- - - -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38- |
-
- # File 'manifests/main/config.pp', line 24
-
-class cd_selinux::main::config (
-
-) inherits cd_selinux::params {
-
- include cd_selinux::main::files
-
- if $sx_selinux_status == 'enforcing' {
- exec { 'set_selinux_status':
- command => 'setenforce 1',
- path => ['/usr/sbin','/usr/bin'],
- provider => shell,
- unless => 'getenforce | grep -i "enforcing"'
- }
- }
-}
- |
-
cd_selinux::main::dirs.pp -Module name: cd_selinux -Author: Arne Teuke -(arne_teuke@ConfDroid.com)
- -This file is part of cd_selinux.
- -cd_selinux is used for providing automatic configuration of SELINUX - -Copyright (C) 2016 ConfDroid (copyright@ConfDroid.com) - This program is -free software: you can redistribute it and/or modify - it under the terms of -the GNU General Public License as published by - the Free Software -Foundation, either version 3 of the License, or - (at your option) any later -version.
- -This program is distributed in the hope that it will be useful, - but -WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License -for more details.
- -You should have received a copy of the GNU General Public License - along -with this program. If not, see www.gnu.org/licenses/.
- -
- - - -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40- |
-
- # File 'manifests/main/dirs.pp', line 23
-
-class cd_selinux::main::dirs (
-
-) inherits cd_selinux::params {
-
- require cd_selinux::main::install
-
- file { $sx_main_dir:
- ensure => directory,
- path => $sx_main_dir,
- owner => 'root',
- group => 'root',
- mode => '0755',
- selrange => s0,
- selrole => object_r,
- seltype => selinux_config_t,
- seluser => system_u,
- }
-}
- |
-
cd_selinux::main::files.pp -Module name: cd_selinux -Author: Arne Teuke -(arne_teuke@ConfDroid.com)
- -This file is part of cd_selinux.
- -cd_selinux is used for providing automatic configuration of SELINUX - -Copyright (C) 2016 ConfDroid (copyright@ConfDroid.com) - This program is -free software: you can redistribute it and/or modify - it under the terms of -the GNU General Public License as published by - the Free Software -Foundation, either version 3 of the License, or - (at your option) any later -version.
- -This program is distributed in the hope that it will be useful, - but -WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License -for more details.
- -You should have received a copy of the GNU General Public License - along -with this program. If not, see www.gnu.org/licenses/.
- -
- - - -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41- |
-
- # File 'manifests/main/files.pp', line 23
-
-class cd_selinux::main::files (
-
-) inherits cd_selinux::params {
-
- require cd_selinux::main::dirs
-
- file { $sx_main_file:
- ensure => file,
- path => $sx_main_file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => selinux_config_t,
- seluser => system_u,
- content => template($sx_main_file_erb),
- }
-}
- |
-
cd_selinux::main::install.pp -Module name: cd_selinux -Author: Arne Teuke -(arne_teuke@ConfDroid.com)
- -This file is part of cd_selinux.
- -cd_selinux is used for providing automatic configuration of SELINUX - -Copyright (C) 2016 ConfDroid (copyright@ConfDroid.com) - This program is -free software: you can redistribute it and/or modify - it under the terms of -the GNU General Public License as published by - the Free Software -Foundation, either version 3 of the License, or - (at your option) any later -version.
- -This program is distributed in the hope that it will be useful, - but -WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License -for more details.
- -You should have received a copy of the GNU General Public License - along -with this program. If not, see www.gnu.org/licenses/.
- -
- - - -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39- |
-
- # File 'manifests/main/install.pp', line 24
-
-class cd_selinux::main::install (
-
-) inherits cd_selinux::params {
-
- require cd_resources
-
- package {$reqpackages_main:
- ensure => $pkg_ensure,
- }
-
- if $sx_install_setools == true {
- package {$reqpackages_tools:
- ensure => $pkg_ensure,
- }
- }
-}
- |
-
cd_selinux::params.pp -Module name: cd_selinux -Author: Arne Teuke -(arne_teuke@ConfDroid.com)
- -This file is part of cd_selinux.
- -cd_selinux is used for providing automatic configuration of SELINUX. - -Copyright (C) 2016 ConfDroid (copyright@ConfDroid.com) - This program is -free software: you can redistribute it and/or modify - it under the terms of -the GNU General Public License as published by - the Free Software -Foundation, either version 3 of the License, or - (at your option) any later -version.
- -This program is distributed in the hope that it will be useful, - but -WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License -for more details.
- -You should have received a copy of the GNU General Public License - along -with this program. If not, see www.gnu.org/licenses/.
- -
- - - -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68- |
-
- # File 'manifests/params.pp', line 38
-
-class cd_selinux::params (
-
-$pkg_ensure = 'latest',
-
-$sx_install_setools = false,
-$sx_selinux_status = 'enforcing',
-$sx_selinux_type = 'targeted',
-
-) {
-
-# installation section
-$reqpackages_main = $::operatingsystem ? {
- /(?i-mx:centos|fedora|redhat)/ => ['selinux-policy','policycoreutils'],
- }
-
-$reqpackages_tools = $::operatingsystem ? {
- /(?i-mx:centos|fedora|redhat)/ => ['setroubleshoot-server',
- 'policycoreutils-python'],
- }
-
-# directories
-$sx_main_dir = '/etc/selinux'
-
-# files
-$sx_main_file = "${sx_main_dir}/config"
-$sx_main_file_erb = 'cd_selinux/main/selinux_config.erb'
-
-
-# includes must be last
- include cd_selinux::main::config
-}
- |
-