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: //lib/python3.9/site-packages/sos/report/plugins/__pycache__/saltmaster.cpython-39.opt-1.pyc
a

\��h�
�@s6ddlZddlZddlmZmZGdd�dee�ZdS)�N)�Plugin�IndependentPluginc@s4eZdZdZdZdZdZdd�Zdd�Zd	d
�Z	dS)�
SaltMasterzSalt MasterZ
saltmaster)Zsysmgmt)zsalt-masterzsalt-apicCsXg|_|�d�r|�d�n
|�d�|�d�|�d�|��|jgd�dd�dS)	NZall_logsz
/var/log/saltz/var/log/salt/masterz	/etc/saltz/etc/salt/pki/*/*.pem)zsalt-master --versionz#systemctl --full status salt-masterz systemctl --full status salt-apizsalt-key --list allz"salt-run jobs.list_jobs --out=yamlz%salt-run manage.list_state --out=yamlz)salt-run manage.list_not_state --out=yamlz!salt-run manage.joined --out=yaml�)�timeout)�collected_pillar_rootsZ
get_option�
add_copy_specZadd_forbidden_path�add_pillar_rootsZadd_cmd_output)�self�r�A/usr/lib/python3.9/site-packages/sos/report/plugins/saltmaster.py�setups




	�zSaltMaster.setupc
Cs�t�d�}d}|�|�r"|�|�g}|D]r}t|ddd��P}zt�|��di��dg�}Wntyrg}Yn0|�|�Wd�q*1s�0Yq*||_	|�
|�dS)	z+ Collect pilliar_roots of all salt configs z/etc/salt/master.d/*confz/etc/salt/master�rzUTF-8)�encodingZpillar_roots�baseN)�globZpath_exists�append�open�yamlZ	safe_load�get�AttributeError�extendrr)r
ZcfgsZmain_cfgZall_pillar_rootsZcfg�fileZcfg_pillar_rootsrrrr	.s"


��
*zSaltMaster.add_pillar_rootscCsRd}d}|�d||�|jD]0}|�d�r.|n|�d�}|�|�d�||�qdS)NzL(^\s*.*(pass|secret|(?<![A-z])key(?![A-z])|api_?key|encryption_?key).*:\ ).+z\1******z/etc/salt/*�/�*)Zdo_path_regex_subr�endswith)r
Zregexp�substZpillar_rootZnormalized_rootrrr�postprocEs�
�zSaltMaster.postprocN)
�__name__�
__module__�__qualname__Z
short_descZplugin_nameZprofilesZpackagesr
r	rrrrrrsr)rrZsos.report.pluginsrrrrrrr�<module>s