Skip to content

Instantly share code, notes, and snippets.

@joseche
Last active November 16, 2015 21:15
Show Gist options
  • Select an option

  • Save joseche/37f8d41c4d253fa04f51 to your computer and use it in GitHub Desktop.

Select an option

Save joseche/37f8d41c4d253fa04f51 to your computer and use it in GitHub Desktop.
selinux blocking nginx or any other program to access files
# 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