-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BREAKING: Redesign selinux::module parameters #178
Comments
Why not just a source_dir parameter? I think for the simple cases we should allow source_te perhaps as well, but having to specify everything separately is not good either, I think. |
Why not just a source_dir parameter? I think for the simple cases we
should allow source_te perhaps as well, but having to specify
everything separately is not good either, I think.
I personally have all my custom modules in 1 folder. this would sync all
my modules at once.
|
@oranenj - tried to write your proposal down as code.
what about dedicated defined types?
seems bloated to me. Still find the dedicated param per file the better option. I can easily validate the parameter, save the files with expected names, decide what the user wants (compile+load or just load). And the parameter names are descriptive/indicative what the content should be (at least IMHO). |
I agree, and like how this looks. We have had the need to setup custom policies as RPMs due to the need to keep "make" and company off our production servers. This would be nice. It does occur to me, that in addition, there should be a way to ensure the version, somehow, but maybe that would be implemented by the type/provider? I can see the case where the policy is updated on the puppet server and the update needs to be propagated to the servers that it is installed on. Maybe RPM's are not such a bad idea, after all? hopefully I didn't complicate this :) ~tommy |
Hmm, yeah. I can see how separate parameters would make the implementation much easier. We need to be really careful with implementing this, since there are many corner cases where a compilation/installation/upgrade of the SELinux module might fail, and we don't want to end up in a situation where the next puppet runs won't even notice that something is wrong as seems to be the case with the current version sometimes. I think the module definitely should manage the source dir and the source files completely (eg. something like $vardir/puppet-selinux/$modulename), and purge them when it stops managing the module (it does not need to remove the module). Perhaps output the resulting .pp file into another path that does not get purged? Also, how does selmodule behave when the policy source is updated without corresponding a version bump in the source? IIRC the current version has problems with that case. Can we detect such a case and issue a warning? The File resource has validate_cmd nowadays, those might be useful. It might be possible to write our own provider for selmodule that extends the built-in provider with any functionality we might need. |
regarding the build/load indempotentcy or constant error-ing when things fail. i thought about something like:
|
the selmodule utility happily installs/overrides an already existing module with unfortunatly selinux utility upstream thought that version numbers in modules are useless and removed the ability to display module versions with the semodule utlity. Fedora 25 example:
no versions anymore. They even introduced this new userspace utlities with EL 7.3 and broke the selmodule types syncversion parameter (https://docs.puppet.com/puppet/latest/type.html#selmodule-attribute-syncversion). Customers complained about this change within a major version and they will re-introduce it for 7.3 as bugfix. anyway you cannot expect to get the version number anymore. so you really don't know which version of your module is loaded. the only way is to track exit codes of commands and ensure they get retried every puppet run. |
@oranenj but maybe this could also be implemented as type/provider - but on the type/provider side i'm very newbie. I think it would then need a dedicated type/provider for building modules as it is a complet other business than loading/removing a module. |
ways to compile a module: the refpolicy style way:
the minimal way:
|
I implemented the suggested changes in the linked PR and I'm pretty happy with how it looks. If no-one has any ideas for an even better interface, feel free to merge that in. |
Current situation
Proposed interface
Things to consider
-X,--priority=PRIORITY
) which isn't supported by the selmodule type. semodule defaults to priority 400 if nothing is defined (seen on EL7, Fedora 25)The text was updated successfully, but these errors were encountered: