问题原文
原帖链接 · Mark C · CC BY-SA 4.0
If I take a policy created, say, using audit2allow -M and install it on multiple servers, will it work as expected or is there something special happening when the policies are created? Ideally I'd like to deploy using Ansible.
已采纳解答
原帖链接 · filbranden · CC BY-SA 4.0
SELinux policy modules are portable and can be copied and reused on other servers.
As long as the servers are using the same policies (versions of the same policies are ok.) For instance, if all your servers are using the "targeted" policy (which is the default on RHEL/CentOS/Fedora), then you should be fine. Some version differences might be tolerable.
Distinct policies might be incompatible with each other, since they define SELinux types (essentially labels, names), these names will be all over your policy modules, so the modules only make sense in hosts that are using the same SELinux types. Furthermore, the rules encoded in that policy module needs to make sense in context of the other rules already in the policy. So that's why you need same (or almost same) policy for this to work.
But other than that, the modules themselves use a portable format, you can easily ship them in binary format and have them loaded on other machines, without having to install the tools that build such modules in the target machines.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
