vagrant-clone 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.idea/.rakeTasks +7 -0
- data/.idea/inspectionProfiles/Project_Default.xml +6 -0
- data/.idea/misc.xml +4 -0
- data/.idea/modules.xml +8 -0
- data/.idea/runConfigurations/clone.xml +21 -0
- data/.idea/runConfigurations/libvirt.xml +21 -0
- data/.idea/vagrant-clone.iml +114 -0
- data/.idea/vcs.xml +6 -0
- data/.idea/workspace.xml +948 -0
- data/Gemfile +9 -3
- data/Gemfile.lock +123 -37
- data/Rakefile +2 -1
- data/Vagrantfile +9 -0
- data/cookbooks/apt/CHANGELOG.md +321 -0
- data/cookbooks/apt/CONTRIBUTING.md +2 -0
- data/cookbooks/apt/MAINTAINERS.md +15 -0
- data/cookbooks/apt/README.md +250 -0
- data/cookbooks/apt/attributes/default.rb +57 -0
- data/cookbooks/apt/files/15update-stamp +1 -0
- data/cookbooks/apt/files/apt-proxy-v2.conf +50 -0
- data/cookbooks/apt/libraries/helpers.rb +49 -0
- data/cookbooks/apt/libraries/matchers.rb +16 -0
- data/cookbooks/apt/metadata.json +1 -0
- data/cookbooks/apt/recipes/cacher-client.rb +52 -0
- data/cookbooks/apt/recipes/cacher-ng.rb +39 -0
- data/cookbooks/apt/recipes/default.rb +93 -0
- data/cookbooks/apt/recipes/unattended-upgrades.rb +47 -0
- data/cookbooks/apt/resources/preference.rb +90 -0
- data/cookbooks/apt/templates/01proxy.erb +11 -0
- data/cookbooks/apt/templates/10dpkg-options.erb +8 -0
- data/cookbooks/apt/templates/10recommends.erb +3 -0
- data/cookbooks/apt/templates/20auto-upgrades.erb +5 -0
- data/cookbooks/apt/templates/50unattended-upgrades.erb +75 -0
- data/cookbooks/apt/templates/acng.conf.erb +275 -0
- data/cookbooks/apt/templates/unattended-upgrades.seed.erb +1 -0
- data/cookbooks/build-essential/.foodcritic +1 -0
- data/cookbooks/build-essential/CHANGELOG.md +257 -0
- data/cookbooks/build-essential/CONTRIBUTING.md +2 -0
- data/cookbooks/build-essential/MAINTAINERS.md +15 -0
- data/cookbooks/build-essential/README.md +134 -0
- data/cookbooks/build-essential/attributes/default.rb +21 -0
- data/cookbooks/build-essential/libraries/matchers.rb +9 -0
- data/cookbooks/build-essential/metadata.json +1 -0
- data/cookbooks/build-essential/recipes/_windows.rb +53 -0
- data/cookbooks/build-essential/recipes/default.rb +24 -0
- data/cookbooks/build-essential/resources/build_essential.rb +106 -0
- data/cookbooks/build-essential/resources/xcode_command_line_tools.rb +61 -0
- data/cookbooks/compat_resource/CHANGELOG.md +53 -0
- data/cookbooks/compat_resource/CONTRIBUTING.md +2 -0
- data/cookbooks/compat_resource/MAINTAINERS.md +16 -0
- data/cookbooks/compat_resource/README.md +60 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/constants.rb +47 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/delayed_evaluator.rb +40 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/core.rb +73 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/declare_resource.rb +315 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/platform_introspection.rb +292 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/recipe.rb +37 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/universal.rb +70 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/lazy_module_include.rb +98 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/notifying_block.rb +74 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/params_validate.rb +510 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/powershell_out.rb +117 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/properties.rb +328 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/property.rb +713 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/apt_repository.rb +269 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/apt_update.rb +105 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/noop.rb +56 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/support/yum_repo.erb +132 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/systemd_unit.rb +253 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/yum_repository.rb +136 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb +164 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/action_class.rb +114 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/apt_repository.rb +65 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/apt_update.rb +52 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/systemd_unit.rb +81 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/yum_repository.rb +97 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource.rb +214 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource_builder.rb +174 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef.rb +29 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/mixin/properties.rb +8 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/exceptions.rb +10 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/log.rb +30 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/mixin/params_validate.rb +17 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/node.rb +9 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/property.rb +15 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/provider.rb +65 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/recipe.rb +118 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/recipe_hook.rb +20 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource/lwrp_base.rb +60 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource.rb +156 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_builder.rb +167 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection/resource_list.rb +49 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection/resource_set.rb +49 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection.rb +103 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb +691 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb +153 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef.rb +33 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches.rb +41 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/property.rb +6 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/recipe.rb +8 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/resource/lwrp_base.rb +44 -0
- data/cookbooks/compat_resource/files/lib/chef_compat/resource.rb +56 -0
- data/cookbooks/compat_resource/files/lib/chef_upstream_version.rb +3 -0
- data/cookbooks/compat_resource/files/lib/compat_resource.rb +35 -0
- data/cookbooks/compat_resource/libraries/autoload.rb +31 -0
- data/cookbooks/compat_resource/metadata.json +1 -0
- data/cookbooks/inifile_chef_gem/CHANGELOG.md +11 -0
- data/cookbooks/inifile_chef_gem/README.md +46 -0
- data/cookbooks/inifile_chef_gem/metadata.json +51 -0
- data/cookbooks/inifile_chef_gem/metadata.rb +11 -0
- data/cookbooks/inifile_chef_gem/resources/default.rb +28 -0
- data/cookbooks/mariadb/CHANGELOG.md +332 -0
- data/cookbooks/mariadb/README.md +225 -0
- data/cookbooks/mariadb/attributes/default.rb +199 -0
- data/cookbooks/mariadb/libraries/mariadb_conn_helper.rb +53 -0
- data/cookbooks/mariadb/libraries/mariadb_helper.rb +216 -0
- data/cookbooks/mariadb/libraries/matchers.rb +21 -0
- data/cookbooks/mariadb/metadata.json +1 -0
- data/cookbooks/mariadb/providers/configuration.rb +39 -0
- data/cookbooks/mariadb/recipes/_audit_plugin.rb +63 -0
- data/cookbooks/mariadb/recipes/_debian_galera.rb +62 -0
- data/cookbooks/mariadb/recipes/_debian_server.rb +78 -0
- data/cookbooks/mariadb/recipes/_mariadb_repository.rb +29 -0
- data/cookbooks/mariadb/recipes/_redhat_client.rb +27 -0
- data/cookbooks/mariadb/recipes/_redhat_galera.rb +55 -0
- data/cookbooks/mariadb/recipes/_redhat_server.rb +58 -0
- data/cookbooks/mariadb/recipes/client.rb +47 -0
- data/cookbooks/mariadb/recipes/config.rb +115 -0
- data/cookbooks/mariadb/recipes/default.rb +46 -0
- data/cookbooks/mariadb/recipes/devel.rb +41 -0
- data/cookbooks/mariadb/recipes/galera.rb +324 -0
- data/cookbooks/mariadb/recipes/plugins.rb +3 -0
- data/cookbooks/mariadb/recipes/repository.rb +45 -0
- data/cookbooks/mariadb/recipes/server.rb +157 -0
- data/cookbooks/mariadb/resources/configuration.rb +13 -0
- data/cookbooks/mariadb/resources/mysql2_gem.rb +25 -0
- data/cookbooks/mariadb/resources/replication.rb +192 -0
- data/cookbooks/mariadb/templates/default/conf.d.generic.erb +19 -0
- data/cookbooks/mariadb/templates/default/debian.cnf.erb +12 -0
- data/cookbooks/mariadb/templates/default/mariadb-server.seed.erb +13 -0
- data/cookbooks/mariadb/templates/default/mariadb_grants.erb +42 -0
- data/cookbooks/mariadb/templates/default/my.cnf.erb +210 -0
- data/cookbooks/mariadb/templates/default/root.cnf.erb +5 -0
- data/cookbooks/mingw/.foodcritic +1 -0
- data/cookbooks/mingw/CHANGELOG.md +50 -0
- data/cookbooks/mingw/CONTRIBUTING.md +2 -0
- data/cookbooks/mingw/MAINTAINERS.md +14 -0
- data/cookbooks/mingw/README.md +133 -0
- data/cookbooks/mingw/files/default/bash.bat +17 -0
- data/cookbooks/mingw/files/default/custom-upgrade.sh +23 -0
- data/cookbooks/mingw/files/default/custom_prefix.sh +13 -0
- data/cookbooks/mingw/files/default/pthread.h +719 -0
- data/cookbooks/mingw/files/default/time.h +297 -0
- data/cookbooks/mingw/libraries/_helper.rb +38 -0
- data/cookbooks/mingw/metadata.json +1 -0
- data/cookbooks/mingw/recipes/default.rb +19 -0
- data/cookbooks/mingw/resources/get.rb +56 -0
- data/cookbooks/mingw/resources/msys2_package.rb +139 -0
- data/cookbooks/mingw/resources/tdm_gcc.rb +114 -0
- data/cookbooks/ohai/.foodcritic +2 -0
- data/cookbooks/ohai/CHANGELOG.md +166 -0
- data/cookbooks/ohai/CONTRIBUTING.md +2 -0
- data/cookbooks/ohai/MAINTAINERS.md +15 -0
- data/cookbooks/ohai/README.md +134 -0
- data/cookbooks/ohai/libraries/matchers.rb +41 -0
- data/cookbooks/ohai/metadata.json +1 -0
- data/cookbooks/ohai/recipes/default.rb +20 -0
- data/cookbooks/ohai/resources/hint.rb +55 -0
- data/cookbooks/ohai/resources/plugin.rb +117 -0
- data/cookbooks/selinux_policy/.gitignore +51 -0
- data/cookbooks/selinux_policy/.kitchen.yml +25 -0
- data/cookbooks/selinux_policy/.rubocop.yml +2 -0
- data/cookbooks/selinux_policy/.travis.yml +26 -0
- data/cookbooks/selinux_policy/Berksfile +8 -0
- data/cookbooks/selinux_policy/CHANGELOG.md +155 -0
- data/cookbooks/selinux_policy/LICENSE +13 -0
- data/cookbooks/selinux_policy/README.md +217 -0
- data/cookbooks/selinux_policy/Rakefile +68 -0
- data/cookbooks/selinux_policy/TESTING.md +2 -0
- data/cookbooks/selinux_policy/Thorfile +12 -0
- data/cookbooks/selinux_policy/attributes/default.rb +5 -0
- data/cookbooks/selinux_policy/chefignore +102 -0
- data/cookbooks/selinux_policy/libraries/helper-disabled.rb +29 -0
- data/cookbooks/selinux_policy/libraries/matchers.rb +57 -0
- data/cookbooks/selinux_policy/metadata.json +58 -0
- data/cookbooks/selinux_policy/metadata.rb +20 -0
- data/cookbooks/selinux_policy/providers/boolean.rb +28 -0
- data/cookbooks/selinux_policy/providers/fcontext.rb +78 -0
- data/cookbooks/selinux_policy/providers/module.rb +81 -0
- data/cookbooks/selinux_policy/providers/permissive.rb +26 -0
- data/cookbooks/selinux_policy/providers/port.rb +58 -0
- data/cookbooks/selinux_policy/recipes/default.rb +9 -0
- data/cookbooks/selinux_policy/recipes/install.rb +32 -0
- data/cookbooks/selinux_policy/resources/boolean.rb +8 -0
- data/cookbooks/selinux_policy/resources/fcontext.rb +8 -0
- data/cookbooks/selinux_policy/resources/module.rb +21 -0
- data/cookbooks/selinux_policy/resources/permissive.rb +6 -0
- data/cookbooks/selinux_policy/resources/port.rb +9 -0
- data/cookbooks/seven_zip/CHANGELOG.md +30 -0
- data/cookbooks/seven_zip/README.md +108 -0
- data/cookbooks/seven_zip/attributes/default.rb +31 -0
- data/cookbooks/seven_zip/libraries/matchers.rb +33 -0
- data/cookbooks/seven_zip/metadata.json +1 -0
- data/cookbooks/seven_zip/providers/archive.rb +68 -0
- data/cookbooks/seven_zip/recipes/default.rb +41 -0
- data/cookbooks/seven_zip/resources/archive.rb +29 -0
- data/cookbooks/windows/.foodcritic +2 -0
- data/cookbooks/windows/CHANGELOG.md +528 -0
- data/cookbooks/windows/CONTRIBUTING.md +2 -0
- data/cookbooks/windows/MAINTAINERS.md +21 -0
- data/cookbooks/windows/README.md +803 -0
- data/cookbooks/windows/attributes/default.rb +21 -0
- data/cookbooks/windows/files/dism_features.rb +45 -0
- data/cookbooks/windows/libraries/matchers.rb +586 -0
- data/cookbooks/windows/libraries/powershell_helper.rb +53 -0
- data/cookbooks/windows/libraries/registry_helper.rb +356 -0
- data/cookbooks/windows/libraries/version.rb +207 -0
- data/cookbooks/windows/libraries/version_helper.rb +79 -0
- data/cookbooks/windows/libraries/windows_helper.rb +174 -0
- data/cookbooks/windows/libraries/windows_privileged.rb +103 -0
- data/cookbooks/windows/libraries/wmi_helper.rb +32 -0
- data/cookbooks/windows/metadata.json +1 -0
- data/cookbooks/windows/recipes/default.rb +21 -0
- data/cookbooks/windows/resources/auto_run.rb +46 -0
- data/cookbooks/windows/resources/certificate.rb +166 -0
- data/cookbooks/windows/resources/certificate_binding.rb +128 -0
- data/cookbooks/windows/resources/feature.rb +82 -0
- data/cookbooks/windows/resources/feature_dism.rb +108 -0
- data/cookbooks/windows/resources/feature_powershell.rb +70 -0
- data/cookbooks/windows/resources/feature_servermanagercmd.rb +76 -0
- data/cookbooks/windows/resources/font.rb +80 -0
- data/cookbooks/windows/resources/http_acl.rb +110 -0
- data/cookbooks/windows/resources/pagefile.rb +152 -0
- data/cookbooks/windows/resources/path.rb +54 -0
- data/cookbooks/windows/resources/printer.rb +103 -0
- data/cookbooks/windows/resources/printer_port.rb +101 -0
- data/cookbooks/windows/resources/share.rb +291 -0
- data/cookbooks/windows/resources/shortcut.rb +53 -0
- data/cookbooks/windows/resources/task.rb +384 -0
- data/cookbooks/windows/resources/zipfile.rb +125 -0
- data/cookbooks/yum/.foodcritic +1 -0
- data/cookbooks/yum/CHANGELOG.md +351 -0
- data/cookbooks/yum/CONTRIBUTING.md +2 -0
- data/cookbooks/yum/MAINTAINERS.md +16 -0
- data/cookbooks/yum/README.md +125 -0
- data/cookbooks/yum/attributes/main.rb +103 -0
- data/cookbooks/yum/libraries/matchers.rb +9 -0
- data/cookbooks/yum/metadata.json +1 -0
- data/cookbooks/yum/recipes/default.rb +26 -0
- data/cookbooks/yum/recipes/dnf_yum_compat.rb +29 -0
- data/cookbooks/yum/resources/globalconfig.rb +119 -0
- data/cookbooks/yum/templates/.DS_Store +0 -0
- data/cookbooks/yum/templates/main.erb +276 -0
- data/cookbooks/yum-epel/CHANGELOG.md +138 -0
- data/cookbooks/yum-epel/CONTRIBUTING.md +2 -0
- data/cookbooks/yum-epel/MAINTAINERS.md +19 -0
- data/cookbooks/yum-epel/README.md +172 -0
- data/cookbooks/yum-epel/attributes/default.rb +8 -0
- data/cookbooks/yum-epel/attributes/epel-debuginfo.rb +15 -0
- data/cookbooks/yum-epel/attributes/epel-source.rb +15 -0
- data/cookbooks/yum-epel/attributes/epel-testing-debuginfo.rb +15 -0
- data/cookbooks/yum-epel/attributes/epel-testing-source.rb +15 -0
- data/cookbooks/yum-epel/attributes/epel-testing.rb +15 -0
- data/cookbooks/yum-epel/attributes/epel.rb +21 -0
- data/cookbooks/yum-epel/metadata.json +1 -0
- data/cookbooks/yum-epel/recipes/default.rb +27 -0
- data/cookbooks/yum-scl/.kitchen.dokken.yml +24 -0
- data/cookbooks/yum-scl/.kitchen.yml +24 -0
- data/cookbooks/yum-scl/.rubocop.yml +6 -0
- data/cookbooks/yum-scl/.travis.yml +28 -0
- data/cookbooks/yum-scl/Berksfile +3 -0
- data/cookbooks/yum-scl/Berksfile.lock +25 -0
- data/cookbooks/yum-scl/CHANGELOG.md +11 -0
- data/cookbooks/yum-scl/Gemfile +46 -0
- data/cookbooks/yum-scl/README.md +76 -0
- data/cookbooks/yum-scl/attributes/centos.rb +83 -0
- data/cookbooks/yum-scl/attributes/default.rb +15 -0
- data/cookbooks/yum-scl/attributes/scientific.rb +1 -0
- data/cookbooks/yum-scl/files/default/RPM-GPG-KEY-CentOS-SIG-SCLo +20 -0
- data/cookbooks/yum-scl/libraries/yum_scl_helper.rb +33 -0
- data/cookbooks/yum-scl/metadata.json +42 -0
- data/cookbooks/yum-scl/metadata.rb +12 -0
- data/cookbooks/yum-scl/recipes/chef_install.rb +52 -0
- data/cookbooks/yum-scl/recipes/default.rb +17 -0
- data/cookbooks/yum-scl/recipes/native_install.rb +35 -0
- data/lib/vagrant-clone/command/clone.rb +66 -61
- data/lib/vagrant-clone/errors.rb +61 -0
- data/lib/vagrant-clone/util/clone_manager_base.rb +69 -0
- data/lib/vagrant-clone/util/clone_managers/docker.rb +31 -0
- data/lib/vagrant-clone/util/clone_managers/libvirt.rb +254 -0
- data/lib/vagrant-clone/util/vagrantfile_managers/docker.rb +154 -0
- data/lib/vagrant-clone/util/vagrantfile_managers/libvirt.rb +159 -0
- data/lib/vagrant-clone/version.rb +2 -2
- data/lib/vagrant-clone.rb +6 -6
- data/libvirt.txt +7 -0
- data/performance_testing.rb +165 -0
- data/results.txt +45 -0
- data/scripts/create_box.sh +134 -0
- data/test.rb +92 -0
- data/tools/create_box.sh +130 -0
- data/vagrant-clone.gemspec +7 -7
- metadata +296 -5
- data/lib/vagrant-clone/command/errors.rb +0 -16
- data/lib/vagrant-clone/command/provider/docker.rb +0 -13
- data/lib/vagrant-clone/utils/vagrantfile_manager.rb +0 -47
@@ -0,0 +1,155 @@
|
|
1
|
+
# selinuxpolicy CHANGELOG
|
2
|
+
|
3
|
+
This file is used to list changes made in each version of the selinuxpolicy cookbook.
|
4
|
+
|
5
|
+
## 2.0.1 (2017-04-21)
|
6
|
+
|
7
|
+
- Perform relabel (restorecon) using find to support regexes
|
8
|
+
|
9
|
+
## 2.0.0 (2017-02-23)
|
10
|
+
|
11
|
+
- This cookbook has been moved to the Sous Chefs org. See sous-chefs.org for more information
|
12
|
+
- Require Chef 12.1 or later
|
13
|
+
- Use compat_resource instead of requiring yum
|
14
|
+
- Don't install yum::dnf_yum_compat on Fedora since Chef has DNF support now
|
15
|
+
- Don't define attributes in the metadata as these aren't used
|
16
|
+
- Remove the Vagrantfile
|
17
|
+
- Add chef_version requirements to the metadata
|
18
|
+
- Test with ChefDK / Rake in Travis instead of gems
|
19
|
+
- Resolve Foodcritic, Cookstyle, and Chefspec warnings
|
20
|
+
|
21
|
+
## 1.1.1
|
22
|
+
|
23
|
+
- [7307850] (Adam Ward) Silence fcontext guard output
|
24
|
+
- [ad71437] (nitz) Restorecon is now done via shell_out
|
25
|
+
- [fa30813] (James Le Cuirot) Change yum dependency to ~> 4.0
|
26
|
+
- [cd9a8da] (nitz) Removed selinux enforcing from kitchen, unified runlists
|
27
|
+
|
28
|
+
## 1.1.0
|
29
|
+
|
30
|
+
- [daften] Added `file_type` for fcontext
|
31
|
+
|
32
|
+
## 1.0.1
|
33
|
+
|
34
|
+
- [backslasher] - Foodcritic and rubocop improvements
|
35
|
+
|
36
|
+
## 1.0.0
|
37
|
+
|
38
|
+
- [equick] - Validating ports better
|
39
|
+
- [backslasher] - FContext relabling for flies is now immediate. (Possibly breaking)
|
40
|
+
- [backslasher] - testing made slightly more elegant
|
41
|
+
|
42
|
+
## 0.9.6
|
43
|
+
|
44
|
+
- [jhmartin] - Updated README
|
45
|
+
- [backslasher] - Major revision of testing
|
46
|
+
|
47
|
+
## 0.9.5
|
48
|
+
|
49
|
+
- [backslasher] - Modified yum dependency
|
50
|
+
|
51
|
+
## 0.9.4
|
52
|
+
|
53
|
+
- [mhorbul] - Fixed state detection in boolean resource
|
54
|
+
|
55
|
+
## 0.9.3
|
56
|
+
|
57
|
+
- [backlsasher] - Fixed testing & kitchen
|
58
|
+
- [jbartko] - Added Fedora support
|
59
|
+
|
60
|
+
## 0.9.2
|
61
|
+
|
62
|
+
- [backslasher] - Ignoring nonexisting files in restorecon
|
63
|
+
|
64
|
+
## 0.9.1
|
65
|
+
|
66
|
+
- [backslasher] - Fixed issue with module being partially executed on machines with SELinux disabled
|
67
|
+
|
68
|
+
## 0.9.0
|
69
|
+
|
70
|
+
- [backslasher] - module overhaul: code refactoring, supporting new input, testing, new actions
|
71
|
+
- [backslasher] - fcontext overhaul: code refactoring, testing, new action
|
72
|
+
|
73
|
+
**Note**: I don't think I have any breaking changes here. If there are, I apologise and request that you create an issue with a test recipe that fails on the problem (so I can reproduce)
|
74
|
+
|
75
|
+
## 0.8.1
|
76
|
+
|
77
|
+
- [backslasher] - Added Travis CI harness
|
78
|
+
- [backslasher] - Fixed typo in README
|
79
|
+
|
80
|
+
## 0.8.0
|
81
|
+
|
82
|
+
- [backslasher] - Test overhaul. Now testing is somewhat reliable when using ports
|
83
|
+
- [backslasher] - Port search is a function
|
84
|
+
- [backslasher] - Port detection now supports ranges. No possibility to add ranges (yet)
|
85
|
+
|
86
|
+
## 0.7.2
|
87
|
+
|
88
|
+
- [shortdudey123] - ChefSpec matchers, helps testing
|
89
|
+
|
90
|
+
## 0.7.1
|
91
|
+
|
92
|
+
- [backslasher] - Forgot contributor
|
93
|
+
|
94
|
+
## 0.7.0
|
95
|
+
|
96
|
+
- [chewi] - Fixed prereq packages
|
97
|
+
- [backslasher] - Modified misleading comment
|
98
|
+
- [chewi] - Move helpers into a cookbook-specific module
|
99
|
+
- [chewi] - Prevent use_selinux from blowing up on systems without getenforce
|
100
|
+
|
101
|
+
## 0.6.5
|
102
|
+
|
103
|
+
- [backslasher] - Ubuntu installation warning
|
104
|
+
|
105
|
+
## 0.6.4
|
106
|
+
|
107
|
+
- [sauraus] - CentOS 7 support
|
108
|
+
- [sauraus] - Typos
|
109
|
+
|
110
|
+
## 0.6.3
|
111
|
+
|
112
|
+
- [backslasher] - Readme updates
|
113
|
+
- [kevans] - Added kitchen testing
|
114
|
+
|
115
|
+
## 0.6.2
|
116
|
+
|
117
|
+
- [kevans] - Support Chef 11.8.0 running shellout!()
|
118
|
+
- [backslasher] - Simplified support info
|
119
|
+
- [backslasher] - ASCIIed files
|
120
|
+
|
121
|
+
## 0.6.1
|
122
|
+
|
123
|
+
- [backslasher] - Migrated to `only_if` instead of if
|
124
|
+
- [backslasher] - README typos
|
125
|
+
|
126
|
+
## 0.6.0
|
127
|
+
|
128
|
+
- [joerg] - Added fcontext resource for managing file contexts under SELinux
|
129
|
+
|
130
|
+
## 0.5.0
|
131
|
+
|
132
|
+
- [backslasher] - Added RHEL5/derivatives support. Thanks to @knightorc.
|
133
|
+
|
134
|
+
```
|
135
|
+
Cookbook will break on RHEL7\. If anyone expiriences this, please check required packages and create an issue/PR
|
136
|
+
```
|
137
|
+
|
138
|
+
- [backslasher] - Machines without SELinux are (opionally) supported. Thanks to @knightroc.
|
139
|
+
|
140
|
+
## 0.4.0
|
141
|
+
|
142
|
+
- [backlasher] - Fixed foodcritic errors
|
143
|
+
|
144
|
+
## 0.3.0
|
145
|
+
|
146
|
+
- [backlasher] - Fixed `install.rb` syntax. Now it actually works
|
147
|
+
|
148
|
+
## 0.2.0
|
149
|
+
|
150
|
+
- [backlasher] - Added module resource. Currently supports deployment and removal (because that's what I need)
|
151
|
+
- [backlasher] - Added permissive resource
|
152
|
+
|
153
|
+
## 0.1.0
|
154
|
+
|
155
|
+
- [backlasher] - Initial release of selinuxpolicy
|
@@ -0,0 +1,13 @@
|
|
1
|
+
This program is free software; you can redistribute it and/or
|
2
|
+
modify it under the terms of the GNU General Public License
|
3
|
+
as published by the Free Software Foundation; either version 2
|
4
|
+
of the License, or (at your option) any later version.
|
5
|
+
|
6
|
+
This program is distributed in the hope that it will be useful,
|
7
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
8
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
9
|
+
GNU General Public License for more details.
|
10
|
+
|
11
|
+
You should have received a copy of the GNU General Public License
|
12
|
+
along with this program; if not, write to the Free Software
|
13
|
+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
@@ -0,0 +1,217 @@
|
|
1
|
+
# SELinux Policy Cookbook
|
2
|
+
|
3
|
+
This cookbook can be used to manage SELinux policies and components (rather than just enable / disable enforcing). I made it because I needed some SELinux settings done, and the `execute`s started to look annoying.
|
4
|
+
|
5
|
+
## Requirements
|
6
|
+
|
7
|
+
Needs an SELinux policy active (so its values can be managed). Can work with a disabled SELinux system (see attribute `allow_disabled`), which will generate warnings and do nothing (but won't break the run). Also requires SELinux's management tools, namely `semanage`, `setsebool` and `getsebool`. Tools are installed by the `selinux_policy::install` recipe (for RHEL/Debian and the like).
|
8
|
+
|
9
|
+
### Chef
|
10
|
+
|
11
|
+
- Chef 12.1+
|
12
|
+
|
13
|
+
### Platforms
|
14
|
+
|
15
|
+
- rhel
|
16
|
+
- fedora
|
17
|
+
|
18
|
+
## Attributes
|
19
|
+
|
20
|
+
These attributes affect the way all of the LWRPs are behaving.
|
21
|
+
|
22
|
+
- `node['selinux_policy']['allow_disabled']` - Whether to allow runs when SELinux is disabled. Will generate warnings, but the run won't fail. Defaults to `true`, set to `false` if you don't have any machines with disabled SELinux.
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
- `selinux_policy::install` - Installs SELinux policy management tools
|
27
|
+
|
28
|
+
This cookbook's functionality is exposed via resources, so it should be called from a wrapper cookbook. Remember to add `depends 'selinux_policy'` to your `metadata.rb`.
|
29
|
+
|
30
|
+
### boolean
|
31
|
+
|
32
|
+
Represents an SELinux [boolean](http://wiki.gentoo.org/wiki/SELinux/Tutorials/Using_SELinux_booleans). You can either `set` it, meaning it will be changed without persistence (it will revert to default in the next reboot), or `setpersist` it (default action), so it'll keep it value after rebooting. Using `setpersist` requires an active policy (so that the new value can be saved somewhere).
|
33
|
+
|
34
|
+
Attributes:
|
35
|
+
|
36
|
+
- `name`: boolean's name. Defaults to resource name.
|
37
|
+
- `value`: Its new value (`true`/`false`).
|
38
|
+
- `force`: Use `setsebool` even if the current value agrees with the requested one.
|
39
|
+
|
40
|
+
Example usage:
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
include_recipe 'selinux_policy::install'
|
44
|
+
|
45
|
+
selinux_policy_boolean 'httpd_can_network_connect' do
|
46
|
+
value true
|
47
|
+
# Make sure nginx is started if this value was modified
|
48
|
+
notifies :start,'service[nginx]', :immediate
|
49
|
+
end
|
50
|
+
```
|
51
|
+
|
52
|
+
**Note**: Due to ruby interperting `0` as `true`, using `value 0` is unwise.
|
53
|
+
|
54
|
+
### port
|
55
|
+
|
56
|
+
Allows assigning a network port to a certain SELinux context. As explained [here](http://wiki.centos.org/HowTos/SELinux#head-ad837f60830442ae77a81aedd10c20305a811388), it can be useful for running Apache on a non-standard port.
|
57
|
+
|
58
|
+
Actions:
|
59
|
+
|
60
|
+
- `addormodify` (default): Assigns the port to the right context, whether it's already listed another context or not at all.
|
61
|
+
- `add`: Assigns the port to the right context it's if not listed (only uses `-a`).
|
62
|
+
- `modify`: Changes the port's context if it's already listed (only uses `-m`).
|
63
|
+
- `delete`: Removes the port's context if it's listed (uses `-d`).
|
64
|
+
|
65
|
+
Attributes:
|
66
|
+
|
67
|
+
- `port`: The port in question, defaults to resource name.
|
68
|
+
- `protocol`: `tcp`/`udp`.
|
69
|
+
- `secontext`: The SELinux context to assign the port to. Unnecessary when using `delete`.
|
70
|
+
|
71
|
+
Example usage:
|
72
|
+
|
73
|
+
```ruby
|
74
|
+
include_recipe 'selinux_policy::install'
|
75
|
+
|
76
|
+
# Allow nginx to bind to port 5678, by giving it the http_port_t context
|
77
|
+
selinux_policy_port '5678' do
|
78
|
+
protocol 'tcp'
|
79
|
+
secontext 'http_port_t'
|
80
|
+
end
|
81
|
+
```
|
82
|
+
|
83
|
+
### module
|
84
|
+
|
85
|
+
Manages SEModules
|
86
|
+
|
87
|
+
Actions:
|
88
|
+
|
89
|
+
- `fetch`: Prepares the module's files for compilation. Allow `remote_directory`-like behavior
|
90
|
+
- `compile`: Translates a module source directory into a `NAME.pp` file. Uses `make` logic for idempotence.
|
91
|
+
- `install`: Adds a compiled module (`pp`) to the current policy. Only installs if the module was modified this run, `force` is enabled or it's missing from the current policy. **Note:** I wish I could compare the existing module to the one generated, but the `extract` capability was only added in [Aug 15](https://github.com/SELinuxProject/selinux/commit/65c6325271b54d3de9c17352a57d469dfbd12729). I'll be happy to see a better idea.
|
92
|
+
- `deploy` (default): Runs `fetch`, `compile`, `install` in that order.
|
93
|
+
- `remove`: Removes a module.
|
94
|
+
|
95
|
+
Attributes:
|
96
|
+
|
97
|
+
- `name`: The module name. Defaults to resource name.
|
98
|
+
- `directory`: Directory where module is stored. Defaults to a directory inside the Chef cache.
|
99
|
+
- `content`: The module content, can be extracted from `audit2allow -m NAME`. This can be used to create simple modules without using external files.
|
100
|
+
- `directory_source`: Copies files cookbook to the module directory (uses `remote_directory`). Allows keeping all of the module's source files in the cookbook. **Note:** You can pre-create the module directory and populate it in any other way you'd choose.
|
101
|
+
- `cookbook`: Modifies the source cookbook for the `remote_directory`.
|
102
|
+
- `force`: Installs the module even if it seems fine. Ruins idempotence but should help solve some weird cases.
|
103
|
+
|
104
|
+
Example usage:
|
105
|
+
|
106
|
+
```ruby
|
107
|
+
include_recipe 'selinux_policy::install'
|
108
|
+
|
109
|
+
# Allow openvpn to write/delete in '/etc/openvpn'
|
110
|
+
selinux_policy_module 'openvpn-googleauthenticator' do
|
111
|
+
content <<-eos
|
112
|
+
module dy-openvpn-googleauthenticator 1.0;
|
113
|
+
|
114
|
+
require {
|
115
|
+
type openvpn_t;
|
116
|
+
type openvpn_etc_t;
|
117
|
+
class file { write unlink };
|
118
|
+
}
|
119
|
+
|
120
|
+
|
121
|
+
#============= openvpn_t ==============
|
122
|
+
allow openvpn_t openvpn_etc_t:file { write unlink };
|
123
|
+
eos
|
124
|
+
action :deploy
|
125
|
+
end
|
126
|
+
```
|
127
|
+
|
128
|
+
### fcontext
|
129
|
+
|
130
|
+
Allows managing the SELinux context of files. This can be used to grant SELinux-protected daemons access to additional / moved files.
|
131
|
+
|
132
|
+
Actions:
|
133
|
+
|
134
|
+
- `addormodify` (default): Assigns the file regexp to the right context, whether it's already listed another context or not at all.
|
135
|
+
- `add`: Assigns the file regexp to the right context it's if not listed (only uses -a).
|
136
|
+
- `modify`: Changes the file regexp context if it's already listed (only uses -m).
|
137
|
+
- `delete`: Removes the file regexp context if it's listed (uses -d).
|
138
|
+
|
139
|
+
Attributes:
|
140
|
+
|
141
|
+
- `file_spec`: This is the file regexp in question, defaults to resource name.
|
142
|
+
- `secontext`: The SELinux context to assign the file regexp to. Not required for `:delete`
|
143
|
+
- `file_type`: Restrict the fcontext to specific file types. See the table below for an overview. See also <https://en.wikipedia.org/wiki/Unix_file_types> for more info
|
144
|
+
- **a** All files
|
145
|
+
- **f** Regular files
|
146
|
+
- **d** Directory
|
147
|
+
- **c** Character device
|
148
|
+
- **b** Block device
|
149
|
+
- **s** Socket
|
150
|
+
- **l** Symbolic link
|
151
|
+
- **p** Namedpipe
|
152
|
+
|
153
|
+
Example usage (see mysql cookbook for example daemons ):
|
154
|
+
|
155
|
+
```ruby
|
156
|
+
include_recipe 'selinux_policy::install'
|
157
|
+
|
158
|
+
# Allow http servers (nginx/apache) to modify moodle files
|
159
|
+
selinux_policy_fcontext '/var/www/moodle(/.*)?' do
|
160
|
+
secontext 'httpd_sys_rw_content_t'
|
161
|
+
end
|
162
|
+
|
163
|
+
# Allow a custom mysql daemon to access its files.
|
164
|
+
{'mysqld_etc_t' => "/etc/mysql-#{service_name}(/.*)?",
|
165
|
+
'mysqld_etc_t' => "/etc/mysql-#{service_name}/my\.cnf",
|
166
|
+
'mysqld_log_t' => "/var/log/mysql-#{service_name}(/.*)?",
|
167
|
+
'mysqld_db_t' => "/opt/mysql_data_#{service_name}(/.*)?",
|
168
|
+
'mysqld_var_run_t' => "/var/run/mysql-#{service_name}(/.*)?",
|
169
|
+
'mysqld_initrc_exec_t' => "/etc/rc\.d/init\.d/mysql-#{service_name}"}.each do |sc, f|
|
170
|
+
selinux_policy_fcontext f do
|
171
|
+
secontext sc
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Adapt a symbolic link
|
176
|
+
selinux_policy_fcontext '/var/www/symlink_to_webroot' do
|
177
|
+
secontext 'httpd_sys_rw_content_t'
|
178
|
+
filetype 'l'
|
179
|
+
end
|
180
|
+
```
|
181
|
+
|
182
|
+
### permissive
|
183
|
+
|
184
|
+
Allows some types to misbehave without stopping them. Not as good as specific policies, but better than disabling SELinux entirely.
|
185
|
+
|
186
|
+
Actions:
|
187
|
+
|
188
|
+
- `add`: Adds a permissive, unless it's already added
|
189
|
+
- `delete`: Deletes a permissive if it's listed
|
190
|
+
|
191
|
+
Example usage:
|
192
|
+
|
193
|
+
```ruby
|
194
|
+
include_recipe 'selinux_policy::install'
|
195
|
+
|
196
|
+
# Disable enforcement on Nginx
|
197
|
+
# As described on http://nginx.com/blog/nginx-se-linux-changes-upgrading-rhel-6-6/
|
198
|
+
|
199
|
+
selinux_policy_permissive 'nginx' do
|
200
|
+
notifies :restart, 'service[nginx]'
|
201
|
+
end
|
202
|
+
```
|
203
|
+
|
204
|
+
## Contributing
|
205
|
+
|
206
|
+
1. Fork the repository
|
207
|
+
2. Create a named feature branch (like `add_component_x`)
|
208
|
+
3. Write your change
|
209
|
+
4. Write tests for your change (if applicable): If fixing a bug, please add regression tests for the RSpec (if possible) and the kitchen If adding a feature, please create basic tests for it, in both RSpec and kitchen
|
210
|
+
5. Run the tests, ensuring they all pass, using `rake testing:user`
|
211
|
+
6. Submit a Pull Request using Github Please **attach the test results** using a gist
|
212
|
+
|
213
|
+
## License and Authors
|
214
|
+
|
215
|
+
- Licensed [GPL v2](http://choosealicense.com/licenses/gpl-2.0/)
|
216
|
+
- Author:: [Nitzan Raz](https://github.com/BackSlasher) ([backslasher](http://backslasher.net))
|
217
|
+
- Maintainer Community:: Sous Chefs [help@sous-chefs.org](mailto:help@sous-chefs.org)
|
@@ -0,0 +1,68 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
|
3
|
+
# Style tests. cookstyle (rubocop) and Foodcritic
|
4
|
+
namespace :style do
|
5
|
+
begin
|
6
|
+
require 'cookstyle'
|
7
|
+
require 'rubocop/rake_task'
|
8
|
+
|
9
|
+
desc 'Run Ruby style checks'
|
10
|
+
RuboCop::RakeTask.new(:ruby)
|
11
|
+
rescue LoadError => e
|
12
|
+
puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV['CI']
|
13
|
+
end
|
14
|
+
|
15
|
+
begin
|
16
|
+
require 'foodcritic'
|
17
|
+
|
18
|
+
desc 'Run Chef style checks'
|
19
|
+
FoodCritic::Rake::LintTask.new(:chef) do |t|
|
20
|
+
t.options = {
|
21
|
+
fail_tags: ['any'],
|
22
|
+
progress: true,
|
23
|
+
exclude: 'spec',
|
24
|
+
}
|
25
|
+
end
|
26
|
+
rescue LoadError => e
|
27
|
+
puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV['CI']
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
desc 'Run all style checks'
|
32
|
+
task style: ['style:chef', 'style:ruby']
|
33
|
+
|
34
|
+
# ChefSpec
|
35
|
+
begin
|
36
|
+
require 'rspec/core/rake_task'
|
37
|
+
|
38
|
+
desc 'Run ChefSpec examples'
|
39
|
+
RSpec::Core::RakeTask.new(:spec)
|
40
|
+
rescue LoadError => e
|
41
|
+
puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV['CI']
|
42
|
+
end
|
43
|
+
|
44
|
+
# Integration tests. Kitchen.ci
|
45
|
+
namespace :integration do
|
46
|
+
begin
|
47
|
+
require 'kitchen/rake_tasks'
|
48
|
+
|
49
|
+
desc 'Run kitchen integration tests'
|
50
|
+
Kitchen::RakeTasks.new
|
51
|
+
rescue LoadError, StandardError => e
|
52
|
+
puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV['CI']
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
namespace :supermarket do
|
57
|
+
begin
|
58
|
+
require 'stove/rake_task'
|
59
|
+
|
60
|
+
desc 'Publish cookbook to Supermarket with Stove'
|
61
|
+
Stove::RakeTask.new
|
62
|
+
rescue LoadError => e
|
63
|
+
puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV['CI']
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# Default
|
68
|
+
task default: %w(style spec)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'bundler'
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'berkshelf/thor'
|
6
|
+
|
7
|
+
begin
|
8
|
+
require 'kitchen/thor_tasks'
|
9
|
+
Kitchen::ThorTasks.new
|
10
|
+
rescue LoadError
|
11
|
+
puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI']
|
12
|
+
end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
# Put files/directories that should be ignored in this file when uploading
|
2
|
+
# to a chef-server or supermarket.
|
3
|
+
# Lines that start with '# ' are comments.
|
4
|
+
|
5
|
+
# OS generated files #
|
6
|
+
######################
|
7
|
+
.DS_Store
|
8
|
+
Icon?
|
9
|
+
nohup.out
|
10
|
+
ehthumbs.db
|
11
|
+
Thumbs.db
|
12
|
+
|
13
|
+
# SASS #
|
14
|
+
########
|
15
|
+
.sass-cache
|
16
|
+
|
17
|
+
# EDITORS #
|
18
|
+
###########
|
19
|
+
\#*
|
20
|
+
.#*
|
21
|
+
*~
|
22
|
+
*.sw[a-z]
|
23
|
+
*.bak
|
24
|
+
REVISION
|
25
|
+
TAGS*
|
26
|
+
tmtags
|
27
|
+
*_flymake.*
|
28
|
+
*_flymake
|
29
|
+
*.tmproj
|
30
|
+
.project
|
31
|
+
.settings
|
32
|
+
mkmf.log
|
33
|
+
|
34
|
+
## COMPILED ##
|
35
|
+
##############
|
36
|
+
a.out
|
37
|
+
*.o
|
38
|
+
*.pyc
|
39
|
+
*.so
|
40
|
+
*.com
|
41
|
+
*.class
|
42
|
+
*.dll
|
43
|
+
*.exe
|
44
|
+
*/rdoc/
|
45
|
+
|
46
|
+
# Testing #
|
47
|
+
###########
|
48
|
+
.watchr
|
49
|
+
.rspec
|
50
|
+
spec/*
|
51
|
+
spec/fixtures/*
|
52
|
+
test/*
|
53
|
+
features/*
|
54
|
+
examples/*
|
55
|
+
Guardfile
|
56
|
+
Procfile
|
57
|
+
.kitchen*
|
58
|
+
.rubocop.yml
|
59
|
+
spec/*
|
60
|
+
Rakefile
|
61
|
+
.travis.yml
|
62
|
+
.foodcritic
|
63
|
+
.codeclimate.yml
|
64
|
+
|
65
|
+
# SCM #
|
66
|
+
#######
|
67
|
+
.git
|
68
|
+
*/.git
|
69
|
+
.gitignore
|
70
|
+
.gitmodules
|
71
|
+
.gitconfig
|
72
|
+
.gitattributes
|
73
|
+
.svn
|
74
|
+
*/.bzr/*
|
75
|
+
*/.hg/*
|
76
|
+
*/.svn/*
|
77
|
+
|
78
|
+
# Berkshelf #
|
79
|
+
#############
|
80
|
+
Berksfile
|
81
|
+
Berksfile.lock
|
82
|
+
cookbooks/*
|
83
|
+
tmp
|
84
|
+
|
85
|
+
# Cookbooks #
|
86
|
+
#############
|
87
|
+
CONTRIBUTING*
|
88
|
+
CHANGELOG*
|
89
|
+
TESTING*
|
90
|
+
MAINTAINERS.toml
|
91
|
+
|
92
|
+
# Strainer #
|
93
|
+
############
|
94
|
+
Colanderfile
|
95
|
+
Strainerfile
|
96
|
+
.colander
|
97
|
+
.strainer
|
98
|
+
|
99
|
+
# Vagrant #
|
100
|
+
###########
|
101
|
+
.vagrant
|
102
|
+
Vagrantfile
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Cookbook: selinux_policy
|
2
|
+
# Library: helper-disabled
|
3
|
+
# 2015, GPLv2, Nitzan Raz (http://backslasher.net)
|
4
|
+
|
5
|
+
require 'chef/mixin/shell_out'
|
6
|
+
include Chef::Mixin::ShellOut
|
7
|
+
|
8
|
+
class Chef
|
9
|
+
module SELinuxPolicy
|
10
|
+
module Helpers
|
11
|
+
# Checks if SELinux is disabled or otherwise unavailable and
|
12
|
+
# whether we're allowed to run when disabled
|
13
|
+
def use_selinux
|
14
|
+
begin
|
15
|
+
getenforce = shell_out!('getenforce')
|
16
|
+
rescue
|
17
|
+
selinux_disabled = true
|
18
|
+
else
|
19
|
+
selinux_disabled = getenforce.stdout =~ /disabled/i
|
20
|
+
end
|
21
|
+
allowed_disabled = node['selinux_policy']['allow_disabled']
|
22
|
+
# return false only when SELinux is disabled and it's allowed
|
23
|
+
return_val = !(selinux_disabled && allowed_disabled)
|
24
|
+
Chef::Log.warn('SELinux is disabled / unreachable, skipping') unless return_val
|
25
|
+
return_val
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
if defined?(ChefSpec)
|
2
|
+
def set_selinux_policy_boolean(resource_name) # rubocop:disable Style/AccessorMethodName
|
3
|
+
ChefSpec::Matchers::ResourceMatcher.new(:selinux_policy_boolean, :set, resource_name)
|
4
|
+
end
|
5
|
+
|
6
|
+
def setpersist_selinux_policy_boolean(resource_name)
|
7
|
+
ChefSpec::Matchers::ResourceMatcher.new(:selinux_policy_boolean, :setpersist, resource_name)
|
8
|
+
end
|
9
|
+
|
10
|
+
def add_selinux_policy_fcontext(resource_name)
|
11
|
+
ChefSpec::Matchers::ResourceMatcher.new(:selinux_policy_fcontext, :add, resource_name)
|
12
|
+
end
|
13
|
+
|
14
|
+
def delete_selinux_policy_fcontext(resource_name)
|
15
|
+
ChefSpec::Matchers::ResourceMatcher.new(:selinux_policy_fcontext, :delete, resource_name)
|
16
|
+
end
|
17
|
+
|
18
|
+
def modify_selinux_policy_fcontext(resource_name)
|
19
|
+
ChefSpec::Matchers::ResourceMatcher.new(:selinux_policy_fcontext, :modify, resource_name)
|
20
|
+
end
|
21
|
+
|
22
|
+
def addormodify_selinux_policy_fcontext(resource_name)
|
23
|
+
ChefSpec::Matchers::ResourceMatcher.new(:selinux_policy_fcontext, :addormodify, resource_name)
|
24
|
+
end
|
25
|
+
|
26
|
+
def deploy_selinux_policy_module(resource_name)
|
27
|
+
ChefSpec::Matchers::ResourceMatcher.new(:selinux_policy_module, :deploy, resource_name)
|
28
|
+
end
|
29
|
+
|
30
|
+
def remove_selinux_policy_module(resource_name)
|
31
|
+
ChefSpec::Matchers::ResourceMatcher.new(:selinux_policy_module, :remove, resource_name)
|
32
|
+
end
|
33
|
+
|
34
|
+
def add_selinux_policy_permissive(resource_name)
|
35
|
+
ChefSpec::Matchers::ResourceMatcher.new(:selinux_policy_permissive, :add, resource_name)
|
36
|
+
end
|
37
|
+
|
38
|
+
def delete_selinux_policy_permissive(resource_name)
|
39
|
+
ChefSpec::Matchers::ResourceMatcher.new(:selinux_policy_permissive, :delete, resource_name)
|
40
|
+
end
|
41
|
+
|
42
|
+
def add_selinux_policy_port(resource_name)
|
43
|
+
ChefSpec::Matchers::ResourceMatcher.new(:selinux_policy_port, :add, resource_name)
|
44
|
+
end
|
45
|
+
|
46
|
+
def delete_selinux_policy_port(resource_name)
|
47
|
+
ChefSpec::Matchers::ResourceMatcher.new(:selinux_policy_port, :delete, resource_name)
|
48
|
+
end
|
49
|
+
|
50
|
+
def modify_selinux_policy_port(resource_name)
|
51
|
+
ChefSpec::Matchers::ResourceMatcher.new(:selinux_policy_port, :modify, resource_name)
|
52
|
+
end
|
53
|
+
|
54
|
+
def addormodify_selinux_policy_port(resource_name)
|
55
|
+
ChefSpec::Matchers::ResourceMatcher.new(:selinux_policy_port, :addormodify, resource_name)
|
56
|
+
end
|
57
|
+
end
|