Skip to content

Instantly share code, notes, and snippets.

@wholevinski
Created August 29, 2017 13:23
Show Gist options
  • Save wholevinski/f968c6a8c6aac960bd6049db3875c2e8 to your computer and use it in GitHub Desktop.
Save wholevinski/f968c6a8c6aac960bd6049db3875c2e8 to your computer and use it in GitHub Desktop.
selinux steps:
# Check for any avc_denied
vi /var/log/audit/audit.log
# Gives a snippet for each denied as to why
audit2allow -w -a
# Shows what allow directives would allow the denied actions
audit2allow -a
# Creates a module that allows all listed actions from the above statement. NOTE: Probably should use grep to filter which ones you want
audit2allow -a -M your_module_name
#Use this one for grep filtering; don't use both commands in conjuction
grep httpd /var/log/audit/audit.log | audit2allow -M httpd_module
#Activate the module
semodule -i your_module_name.pp
If selinux is SILENTLY failing...try disabling "dontaudit rules" like this:
semodule -DB
Also, if you run into this:
>> audit2allow -a
[Errno 2] No such file or directory: '/etc/selinux/targeted/contexts/files/file_contexts.local'
Run:
>> touch /etc/selinux/targeted/contexts/files/file_contexts.local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment