Last active
November 16, 2015 21:15
-
-
Save joseche/37f8d41c4d253fa04f51 to your computer and use it in GitHub Desktop.
selinux blocking nginx or any other program to access files
This file contains hidden or 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
| # install tools | |
| yum install -y policycoreutils-devel | |
| # create policy from logs | |
| grep nginx /var/log/audit/audit.log | audit2allow -M nginx | |
| # add policy to allowed policies | |
| semodule -i nginx.pp | |
| # more info | |
| grep nginx /var/log/audit/audit.log | audit2why | |
| Was caused by: | |
| Missing type enforcement (TE) allow rule. | |
| You can use audit2allow to generate a loadable module to allow this access. | |
| # to add permission by role: | |
| semanage permissive -a httpd_t | |
| # to remove permission by role: | |
| semanage permissive -d httpd_t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment