• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

SElinux, proftpd + httpd_sys_rw_content_t dir

Burnout

New Pleskian
Hi,

On a CentOS (6) system, when the httpd service creates a directory, it gets the following selinux properties: "scontext=system_u:system_r:ftpd_t:s0-s0:c0.c1023 tcontext=system_u:eek:bject_r:httpd_sys_rw_content_t:s0 tclass=dir"

Now, this directory isn't readable or writable with proftpd. How can I give proftpd access to the directory?
Keep in mind, I don't want to turn of SElinux or edit the allow_ftpd_full_access boolean. Also I prefer to not edit the fcontext.

Thx for your feedback!


Kind regards,
Burn
 
For whom it might interest, I did some investigations and managed to write the following (working) module:
Code:
module ftpd.custom 1.0;

require {
   type ftpd_t;
   type httpd_sys_rw_content_t;
   class file { create open unlink setattr };
   class dir { read add_name search rmdir getattr write create open setattr remove_name rename };
}

#============= ftpd_t ==============

#!!!! This avc can be allowed using the boolean 'allow_ftpd_full_access'
allow ftpd_t httpd_sys_rw_content_t:dir { create read add_name search rmdir getattr write open remove_name setattr rename };
allow ftpd_t httpd_sys_rw_content_t:file { create open unlink setattr };

If you want to use it, you need to check, compile and load it:
Code:
# checkmodule -M -m -o ftpd.custom.mod ftpd.custom.te
# semodule_package -o ftpd.custom.pp -m ftpd.custom.mod
# semodule -i ftpd.custom.pp
 
Back
Top