audit2allow throws "[Errno 2] No such file or directory: '/etc/selinux/targeted/contexts/files/file_contexts.local'"

Solution Verified - Updated -

Issue

  • On a RHEL7.3 system with SELinux set to permissive/enforcing mode,audit2allow throws below error:
[Errno 2] No such file or directory: '/etc/selinux/targeted/contexts/files/file_contexts.local'
  • /etc/selinux/targeted/contexts/files/file_contexts.local file is missing.
# ls -lt /etc/selinux/targeted/contexts/files/
total 1804
-rw-r--r--. 1 root root  378732 Mar  3 11:27 file_contexts
-rw-r--r--. 1 root root 1394978 Mar  3 11:27 file_contexts.bin
-rw-r--r--. 1 root root   13169 Mar  3 11:27 file_contexts.homedirs
-rw-r--r--. 1 root root   44725 Mar  3 11:27 file_contexts.homedirs.bin
-rw-r--r--. 1 root root       0 Feb  7 19:51 file_contexts.subs
-rw-r--r--. 1 root root     422 Feb  7 19:51 file_contexts.subs_dist
-rw-r--r--. 1 root root     139 Feb  7 19:22 media

Environment

  • Red Hat Enterprise Linux 7.3
  • selinux-policy-3.13.1-102.el7_3.15.noarch
  • selinux-policy-targeted-3.13.1-102.el7_3.15.noarch

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.