Bug 2188173

Summary: The files(/usr/lib/systemd/system/proftpd.* & /usr/lib/systemd/system/vsftpd.*) are labeled with 'iptables_unit_file_t' context in the SELinux policy (policy/modules/contrib/ftp.fc).
Product: Red Hat Enterprise Linux 9 Reporter: Abhijeet Joshi <abjoshi>
Component: selinux-policyAssignee: Nobody <nobody>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: high Docs Contact:
Priority: high    
Version: 9.0CC: lvrabec, mmalik, zpytela
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-38.1.14-1.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-07 08:52:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Deadline: 2023-05-30   

Description Abhijeet Joshi 2023-04-20 01:17:37 UTC
Description of problem:
----------------------------

* The files(/usr/lib/systemd/system/proftpd.* & /usr/lib/systemd/system/vsftpd.*) are labeled as 'iptables_unit_file_t' in the SELinux policy(policy/modules/contrib/ftp.fc) rather than 'ftpd_unit_file_t', which is what is expected given that type is defined in the 'ftp.te' file and all other files in the 'ftp.fc' file are labeled with a 'ftpd_*_t type' or 'xferlog_t' but that's expected.


Version-Release number of selected component (if applicable):
--------------------------------------------------------------
* Red Hat Enterprise Linux 9.x


How reproducible:
--------------------
* Always reproducible. 


Actual results:
----------------
* The files are not labeled properly.
--------------------------------------------------------
[root@rhel9 ~]# semanage fcontext -l | grep -i "vsftpd\|proftpd" | sort
/etc/cron\.monthly/proftpd                         regular file       system_u:object_r:ftpd_exec_t:s0 
/etc/proftpd\.conf                                 regular file       system_u:object_r:ftpd_etc_t:s0 
/etc/rc\.d/init\.d/proftpd                         regular file       system_u:object_r:ftpd_initrc_exec_t:s0 
/etc/rc\.d/init\.d/vsftpd                          regular file       system_u:object_r:ftpd_initrc_exec_t:s0 
/usr/libexec/webmin/vsftpd/webalizer/xfer_log      regular file       system_u:object_r:xferlog_t:s0 
/usr/lib/systemd/system/proftpd.*                  regular file       system_u:object_r:iptables_unit_file_t:s0 
/usr/lib/systemd/system/vsftpd.*                   regular file       system_u:object_r:iptables_unit_file_t:s0 
/usr/sbin/proftpd                                  regular file       system_u:object_r:ftpd_exec_t:s0 
/usr/sbin/vsftpd                                   regular file       system_u:object_r:ftpd_exec_t:s0 
/var/log/proftpd(/.*)?                             all files          system_u:object_r:xferlog_t:s0 
/var/log/proftpd\.log                              regular file       system_u:object_r:xferlog_t:s0 
/var/log/vsftpd.*                                  regular file       system_u:object_r:xferlog_t:s0 
/var/run/proftpd.*                                 all files          system_u:object_r:ftpd_var_run_t:s0 


[root@rhel9 ~]# semanage fcontext -l | grep -i iptables_unit_file_t
/usr/lib/systemd/system/arptables.*                regular file       system_u:object_r:iptables_unit_file_t:s0 
/usr/lib/systemd/system/ip6tables.*                regular file       system_u:object_r:iptables_unit_file_t:s0 
/usr/lib/systemd/system/ipset.*                    regular file       system_u:object_r:iptables_unit_file_t:s0 
/usr/lib/systemd/system/iptables.*                 regular file       system_u:object_r:iptables_unit_file_t:s0 
/usr/lib/systemd/system/ppp.*                      regular file       system_u:object_r:iptables_unit_file_t:s0 
/usr/lib/systemd/system/proftpd.*                  regular file       system_u:object_r:iptables_unit_file_t:s0 
/usr/lib/systemd/system/vsftpd.*                   regular file       system_u:object_r:iptables_unit_file_t:s0 
--------------------------------------------------------

Expected results:
------------------
* Files should be labeled with 'ftpd_unit_file_t.'

Additional info:

Comment 11 errata-xmlrpc 2023-11-07 08:52:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (selinux-policy bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6617