HEX
Server: Apache
System: Linux dinesh8189 5.15.98-grsec-sharedvalley-2.lc.el8.x86_64 #1 SMP Thu Mar 9 09:07:30 -03 2023 x86_64
User: cgmgerenciamento1 (814285)
PHP: 8.1.26
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //usr/lib/python3.6/site-packages/sos/report/plugins/__pycache__/ssh.cpython-36.pyc
3

3��d
�@s*ddlmZmZmZGdd�dee�ZdS)�)�Plugin�IndependentPlugin�	PluginOptc@sBeZdZdZdZdZedded	d
�gZdd�Z	d
d�Z
dd�ZdS)�SshzSecure shell serviceZssh�services�security�system�identity�	userconfsTz5Changes whether module will collect user .ssh configs)�defaultZval_typeZdesccCsB|jddd��ddg}|j|�|j|�|jd�r>|j�dS)NZsshd_configZ
ssh_config)z/etc/ssh/sshd_config$z/etc/ssh/ssh_config$z/etc/ssh/ssh_configz/etc/ssh/sshd_configr
)Z
add_file_tags�
add_copy_spec�included_configsZ
get_option�user_ssh_files_permissions)�self�sshcfgs�r�/usr/lib/python3.6/ssh.py�setups



z	Ssh.setupcCs�y�x�|D]�}|jd�d}t|j|�d��X}xP|D]H}t|j��dks2|jd�rRq2|j�jd�r2|j�}|j|d|d�q2WWdQRXqWWntk
r�YnXdS)	N�/��rr�#�include)Ztags���)�split�open�	path_join�len�
startswith�lowerr�	Exception)rrZsshcfg�tagZcfgfile�lineZconfargrrrr
0s

(zSsh.included_configscCs�|jd�}|drZy&t|jd���}|j�}WdQRXWqftk
rV|jd�dSXn|dj�}xV|D]N}y4|j|jd�dd	�}|j|�r�|j	d
j
|��Wqltk
r�YqlXqlWdS)z�
        Iterate over .ssh folders in user homes to see their permissions.

        Bad permissions can prevent SSH from allowing access to given user.
        z
getent passwdZstatusz/etc/passwdNzCouldn't read /etc/passwd�output�:�z.sshz
ls -laZ {})Zexec_cmdrr�	readlinesr Z
_log_error�
splitlinesrZ
path_isdirZadd_cmd_output�format�
IndexError)rZ
users_dataZpasswd_fileZusers_data_linesZusr_lineZhome_dirrrrrAs 



zSsh.user_ssh_files_permissionsN)rrrr	)�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesr�strZoption_listrr
rrrrrrs
rN)Zsos.report.pluginsrrrrrrrr�<module>s