forked from voxpupuli/puppet-selinux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request voxpupuli#195 from vinzent/module_refactor_refpoli…
…cy_test Redesign selinux::module defined type
- Loading branch information
Showing
16 changed files
with
459 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,15 @@ running system. | |
* Mailinglist: <[email protected]> | ||
([groups.io Webinterface](https://groups.io/g/voxpupuli/topics)) | ||
|
||
## 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 | ||
|
||
## Known problems / limitations | ||
|
||
|
@@ -51,8 +60,6 @@ running system. | |
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) | ||
* `selinux::module` only allows to add a type enforcment file (`*.te`) but no | ||
interfaces (`*.if`) or file-contexts (`*.fc`). | ||
* While SELinux is disabled the defined types `selinux::boolean`, | ||
`selinux::fcontext`, `selinux::port` will produce puppet agent runtime errors | ||
because the used tools fail. | ||
|
@@ -97,12 +104,15 @@ are `target`, `minimum`, and `mls`). Note that disabling SELinux requires a rebo | |
to fully take effect. It will run in `permissive` mode until then. | ||
|
||
|
||
### Deploy a custom module | ||
### Deploy a custom module using the refpolicy framework | ||
|
||
```puppet | ||
selinux::module { 'resnet-puppet': | ||
ensure => 'present', | ||
source => 'puppet:///modules/site_puppet/site-puppet.te', | ||
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' | ||
} | ||
``` | ||
|
||
|
@@ -131,9 +141,9 @@ selinux::boolean { 'puppetagent_manage_all_files': } | |
* run acceptance tests: | ||
|
||
``` | ||
BEAKER_debug=yes BEAKER_set="centos-6-x64" PUPPET_INSTALL_TYPE="agent" bundle exec rake beaker | ||
BEAKER_debug=yes BEAKER_set="centos-7-x64" PUPPET_INSTALL_TYPE="agent" bundle exec rake beaker | ||
BEAKER_debug=yes BEAKER_set="fedora-24-x64" PUPPET_INSTALL_TYPE="agent" bundle exec rake beaker | ||
BEAKER_debug=yes BEAKER_set="centos-6-x64" PUPPET_INSTALL_TYPE="agent" bundle exec rake beaker && | ||
BEAKER_debug=yes BEAKER_set="centos-7-x64" PUPPET_INSTALL_TYPE="agent" bundle exec rake beaker && | ||
BEAKER_debug=yes BEAKER_set="fedora-24-x64" PUPPET_INSTALL_TYPE="agent" bundle exec rake beaker && | ||
BEAKER_debug=yes BEAKER_set="fedora-25-x64" PUPPET_INSTALL_TYPE="agent" bundle exec rake beaker | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
module_name="$1" | ||
module_dir="$2" | ||
|
||
set -e | ||
|
||
cd $module_dir | ||
test -d tmp || mkdir tmp | ||
|
||
checkmodule -M -m -o tmp/${module_name}.mod ${module_name}.te | ||
package_args="-o ${module_name}.pp -m tmp/${module_name}.mod" | ||
if [ -s "${module_name}.fc" ]; then | ||
package_args="${package_args} --fc ${module_name}.fc" | ||
fi | ||
|
||
semodule_package ${package_args} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'puppet' | ||
Facter.add(:selinux_agent_vardir) do | ||
setcode do | ||
Puppet.settings['vardir'] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.