RHEL - New directories created in / during provisioning automatically apply incorrect etc_runtime_t SELinux context
Issue
- By default, newly-created files and directories inherit the SELinux type of their parent directories.
-
However, when installing a RHEL 8.3 system with non-standard mount points such as
/applications
, the directory is created withetc_runtime_t
SELinux context instead ofdefault_t
.# ls -Zd /applications drwxr-xr-x. 2 root root unconfined_u:object_r:etc_runtime_t:s0 6 Mar 1 12:24 applications
-
Running
restorecon -Rv
command after the build is complete, automatically applies correctdefault_t
SELinux context. - Creating new directories in
/
after the RHEL 8.3 system has been installed, automatically applies the expecteddefault_t
SELinux context.
Environment
- Red Hat Enterprise Linux 8.3.
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.