--When it is detected in audit.log that a specific process is blocked by SELinux.
sudo audit2allow -w -a
sudo audit2allow -a
sudo audit2allow -a -M policy file name
sudo semodule -i policy file name.pp
Confirm that the applied policy is displayed.
sudo semodule -l
[stack@rhosp-dir01 ~]$ python Python 2.7.5 (default, Jun 11 2019, 14:33:56) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> >>> import sepolicy >>>
>>> sepolicy.search ([sepolicy.ALLOW], {sepolicy.TARGET:'context in policy file'})
Example >>> sepolicy.search([sepolicy.ALLOW],{sepolicy.TARGET:'logrotate_t'}) [{'target': 'domain', 'enabled': True, 'source': 'nagios_openshift_plugin_t', 'permlist': ['read', 'getattr'], 'type': 'allow', 'class': 'lnk_file'}, abridgement
Recommended Posts