o
    O6uf5  ã                   @   sB   d dl mZmZmZmZ G dd„ deeeƒZG dd„ deeƒZdS )é    )ÚPluginÚRedHatPluginÚDebianPluginÚUbuntuPluginc                   @   s,   e Zd ZdZdZdZdZdd„ Zdd„ Zd	S )
ÚForemanInstallerz Foreman installer and maintainerÚforeman_installer)Úsysmgmt)zforeman-installerzrubygem-foreman_maintainc                 C   s(   |   g d¢¡ |  d¡ |  dg¡ d S )N)z/etc/foreman-installer/*z/var/log/foreman-installer/*z/var/log/foreman-maintain/*z"/var/lib/foreman-maintain/data.ymlz*/etc/foreman-maintain/foreman_maintain.ymlz-/etc/foreman-installer/scenarios.d/*/.appliedz4/etc/foreman-installer/scenarios.d/*.migrations/*.rbzforeman-maintain service status)Úadd_copy_specÚadd_forbidden_pathÚadd_cmd_output©Úself© r   úF/usr/lib/python3/dist-packages/sos/report/plugins/foreman_installer.pyÚsetup   s   ÿ
ÿzForemanInstaller.setupc                 C   s‚   d}d}|   ||d¡ d}|   ||d¡ |   |dd¡ |   dd	d¡ |   d
dd¡ |   d|› d�dd¡ |   d|› d�dd¡ d S )Nz/var/log/foreman-installer/z~((foreman.*)?(\"::(foreman(.*?)|katello).*)?((::(.*)::.*(passw|cred|token|secret|key).*(\")?:)|(storepass )|(password =)))(.*)z\1 ********zZ(\s)+(Found key: (\"(foreman(.*?)|katello)::(.*(token|secret|key|passw).*)\") value:) (.*)z\1 \2 ********z%((\.|_|-)password(=\'|=|\", \"))(\w*)z
\1********z)/var/log/foreman-installer/foreman-proxy*z(\s*proxy_password\s=) (.*)z//var/log/foreman-maintain/foreman-maintain.log*z.(((passw|cred|token|secret)=)|(password ))(.*)z7(/etc/foreman-(installer|maintain)/(.*)((conf)(.*)?))|(ú)z5((\:|\s*)(passw|cred|token|secret|key).*(\:\s|=))(.*)z;(/etc/foreman-(installer|maintain)/(.*)((yaml|yml)(.*)?))|(z\1"********")Údo_path_regex_sub)r   Úinstall_logsÚlogsregÚlogs_debug_regr   r   r   Úpostproc-   sD   ýýýÿüÿüzForemanInstaller.postprocN)	Ú__name__Ú
__module__Ú__qualname__Ú
short_descÚplugin_nameÚprofilesÚpackagesr   r   r   r   r   r   r      s    r   c                       s   e Zd Z‡ fdd„Z‡  ZS )ÚRedHatForemanInstallerc                    s&   |   ddgddgdœ¡ tƒ  ¡  d S )NÚforeman_satellite_logÚsatellite_installer_logÚcapsule_logÚcapsule_installer_log)z(/var/log/foreman-installer/satellite.logz&/var/log/foreman-installer/capsule.log)Úadd_file_tagsÚsuperr   r   ©Ú	__class__r   r   r   X   s
   üzRedHatForemanInstaller.setup)r   r   r   r   Ú__classcell__r   r   r%   r   r   V   s    r   N)Úsos.report.pluginsr   r   r   r   r   r   r   r   r   r   Ú<module>   s   
G