HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/share/setroubleshoot/plugins/__pycache__/allow_anon_write.cpython-39.opt-1.pyc
a

�Z`
�@sDddlZejddd�ZejZddlTddlmZGdd�de�ZdS)	�Nzsetroubleshoot-pluginsT)Zfallback)�*)�Pluginc@sLeZdZed�Zed�Zed�Zed�Zed�Zdd�Z	dd	�Z
d
d�ZdS)
�pluginz^
    SELinux policy is preventing an httpd script from writing to a public
    directory.
    z�
    SELinux policy is preventing an httpd script from writing to a public
    directory.  If httpd is not setup to write to public directories, this
    could signal an intrusion attempt.
    a

    If httpd scripts should be allowed to write to public directories you need to turn on the $BOOLEAN boolean and change the file context of the public directory to public_content_rw_t.  Read the httpd_selinux
    man page for further information:
    "setsebool -P $BOOLEAN=1; chcon -t public_content_rw_t <path>"
    You must also change the default file context labeling files on the system in order to preserve public directory labeling even on a full relabel.  "semanage fcontext -a -t public_content_rw_t <path>"
    zNIf you want to allow $SOURCE_PATH to be able to write to shared public contentz�you need to change the label on $TARGET_PATH to public_content_rw_t, and potentially turn on the allow_httpd_sys_script_anon_write boolean.cCsd|}|S)Nzo# semanage fcontext -a -t public_content_rw_t $TARGET_PATH
# restorecon -R -v $TARGET_PATH
# setsebool -P %s %s�)�self�avc�argsZdo_textrr�5/usr/share/setroubleshoot/plugins/allow_anon_write.py�get_do_text/s�zplugin.get_do_textcCst�|t�d|_dS)NZgreen)r�__init__�__name__�level)rrrr	r5szplugin.__init__cCs�|�dg�r�|�|j�r�|�dg�r.|�d�S|�dg�rD|�d�S|�dg�rZ|�d�S|�dg�rp|�d	�S|�d
g�r�|�d�S|�dg�r�|�d
�SdS)NZpublic_content_tZhttpd_t)Zallow_httpd_anon_write�1Zhttpd_sys_script_t)Z!allow_httpd_sys_script_anon_writerZftpd_t)Zallow_ftpd_anon_writerZnfsd_t)Zallow_nfsd_anon_writerZrsync_t)Zallow_rsync_anon_writerZsmbd_t)Zallow_smbd_anon_writer)Zmatches_target_typesZall_accesses_are_inZcreate_file_permsZmatches_source_typesZreport)rrrrr	�analyze9s 
�





zplugin.analyzeN)r�
__module__�__qualname__�_ZsummaryZproblem_descriptionZfix_descriptionZif_textZ	then_textr
rrrrrr	rsr)�gettextZtranslationrZsetroubleshoot.utilZsetroubleshoot.Pluginrrrrrr	�<module>s