-
Story
-
Resolution: Unresolved
-
Undefined
-
None
-
rhel-9.3.0
-
None
-
rhel-sst-security-selinux
-
ssg_security
-
None
-
False
-
-
None
-
Red Hat Enterprise Linux
-
None
-
None
-
None
-
None
This RFE was filed as BZ 1968163 on Fedora but didn't get traction at all, I'm convinced this would be very helpful on RHEL.
Goal
- As an administrator, I would like to create equivalent contexts for custom project directories containing path regex "." or "[^/]" to simplify out-of-tree management
Use Case 1
My project stores file system trees under /var/myproject/fs/SOMEDIR, with SOMEDIR being the name of the filesystem tree, e.g. /var/myproject/packages/rhel7.1 and /var/myproject/packages/rhel8.1
Since these file system trees will be accessed through a chroot, I want to have the proper label applied.
The easiest way would be to create an equivalency rule from / to /var/myproject/fs/SOMEDIR, as shown below:
1. either "/var/myproject/fs/[^/]* = /"
2. or "/var/myproject/fs/.* = /"
Unfortunately this doesn't work at all, the context remains var_t:
$ matchpathcon -m d /var/myproject/fs/rhel7.1/usr/bin
[...] system_u:object_r:var_t:s0
Use Case 2
RHEL customers using custom trees for their applications, typically under /apps/projectX would also benefit from this and make their lives easier, especially when applications are deployed using symlinks to specific versions, e.g.:
# ls -l /apps [...] myapp-1.1 [...] myapp-1.2 [...] myapp-1.3 [...] myapp -> myapp-1.3
Acceptance Criteria
A list of verification conditions, successful functional tests, or expected outcomes in order to declare this story/task successfully completed.
- Create equivalent path to / for /var/myproject/fs/[^/]*, execute restorecon or matchpathcon and confirm /var/myproject/fs/project is labeled with root_t
- Create equivalent path to / for /var/myproject/fs/.*, execute restorecon or matchpathcon and confirm /var/myproject/fs/project is labeled with root_t