HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux ns565604.ip-54-39-133.net 4.18.0-553.50.1.el8_10.x86_64 #1 SMP Tue Apr 15 08:09:22 EDT 2025 x86_64
User: greer489 (1034)
PHP: 8.3.19
Disabled: NONE
Upload Files
File: //usr/share/setroubleshoot/plugins/__pycache__/allow_anon_write.cpython-36.pyc
3

nm�a
�@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/szplugin.get_do_textcCstj|t�d|_dS)NZgreen)r�__init__�__name__�level)rrrr	r5szplugin.__init__cCs�|jdg�r�|j|j�r�|jdg�r.|jd�S|jdg�rD|jd�S|jdg�rZ|jd�S|jd	g�rp|jd�S|jdg�r�|jd�S|jd
g�r�|jd�SdS)NZpublic_content_tZhttpd_t�allow_httpd_anon_write�1Zhttpd_sys_script_t�!allow_httpd_sys_script_anon_writeZftpd_t�allow_ftpd_anon_writeZnfsd_t�allow_nfsd_anon_writeZrsync_t�allow_rsync_anon_writeZsmbd_t�allow_smbd_anon_write)rr)rr)rr)rr)rr)rr)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