Current File : //usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/krb5.cpython-312.pyc
�

-�_g���t�ddlZddlZddlmZmZmZmZGd�de�ZGd�dee�ZGd�deee�Z	y)	�N)�Plugin�RedHatPlugin�DebianPlugin�UbuntuPluginc�,�eZdZdZdZdZdZdZd�Zd�Z	y)�Krb5a:This plugin handles the collection of kerberos authentication config
    files and logging. Users should expect to see their krb5 config(s) in the
    final archive, along with krb5 logging and `klist` output.

    kdc configs and acls will also be collected from the distribution-spcecific
    kdc directory.
    zKerberos authentication�krb5)�identity�systemNc�
�|jdd|j�d�|j�d�dg�|j�|jdd��|jd	|j�d
��|jd�y)Nz/etc/krb5.confz/etc/krb5.conf.d/*z
/kadm5.aclz	/kdc.confz/var/log/kadmind.logz/var/log/krb5kdc.log�kerberos_kdc_log)�tagszklist -ket z/.k5*zklist -ket /etc/krb5.keytab)�
add_copy_spec�kdcdir�
collect_kinit�add_cmd_output)�selfs �9/usr/lib/python3/dist-packages/sos/report/plugins/krb5.py�setupz
Krb5.setups������� ��{�{�m�:�&��{�{�m�9�%�"�
�	�	
�������1�8J��K����k�$�+�+��e�<�=����9�:�c���tj�}d}|j|�r�t|dd��5}|D]�}t	j
d|tj�r<|jd�ddd	j�}|jd
|�d��n>t	j
d|tj�s��|jd
|�d
��nddd�yy#1swYyxYw)a)
        Collect the kinit command output for the system with id_provider "AD"
        or "IPA" domains.

        While integrating the Linux M/c with AD the realmd will create a
        computer object on the AD side. The realmd and AD restrict the
        Hostname/SPN to 15 Characters.
        z/etc/sssd/sssd.conf�rzutf-8)�encodingz\s*id_provider\s*=\s*ad�.rN�zMKRB5_TRACE=/dev/stdout                                             kinit -k 'z$'z\s*id_provider\s*=\s*ipa�')
�socket�getfqdn�path_isfile�open�re�match�
IGNORECASE�split�upperr)r�hostname�	sssd_conf�f�lines     rrzKrb5.collect_kinit+s����>�>�#��)�	����I�&��i��w�7�
�1���D��x�x� :� $�b�m�m�5�#+�>�>�#�#6�q�#9�#�2�#>�#D�#D�#F���+�+�/7�7?�j��-D�E���x�x� ;� $�b�m�m�5��+�+�/7�7?�j��-C�D���
�
�'�
�
�s�BC%�C%�%C.)
�__name__�
__module__�__qualname__�__doc__�
short_desc�plugin_name�profilesrrr�rrrrs'���+�J��K�%�H�
�F�;�rrc��eZdZdZdZy)�
RedHatKrb5)z	krb5-libszkrb5-serverz/var/kerberos/krb5kdcN�r*r+r,�packagesrr1rrr3r3Gs��+�H�
$�Frr3c��eZdZdZdZy)�
UbuntuKrb5)zkrb5-kdczkrb5-configz	krb5-userz/var/lib/krb5kdcNr4r1rrr7r7Ms��7�H�
�Frr7)
r!r�sos.report.pluginsrrrrrr3r7r1rr�<module>r9s>��
�
�O�O�4�6�4�n%��|�%� ��|�\� r