관리-도구
편집 파일: krb5.cpython-39.opt-1.pyc
a -�_g� � @ sb d dl Z d dlZd dlmZmZmZmZ G dd� de�ZG dd� dee�ZG dd� deee�Z dS ) � N)�Plugin�RedHatPlugin�DebianPlugin�UbuntuPluginc @ s0 e Zd ZdZdZdZdZdZdd� Zdd � Z dS ) �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 authenticationZkrb5)�identity�systemNc C s\ | � dd| j� d�| j� d�dg� | �� | j ddd� | �d | j� d �� | �d� d S )Nz/etc/krb5.confz/etc/krb5.conf.d/*z /kadm5.aclz /kdc.confz/var/log/kadmind.logz/var/log/krb5kdc.logZkerberos_kdc_log)�tagszklist -ket z/.k5*zklist -ket /etc/krb5.keytab)Z add_copy_spec�kdcdir� collect_kinit�add_cmd_output)�self� r �;/usr/lib/python3.9/site-packages/sos/report/plugins/krb5.py�setup s �z Krb5.setupc C s� t �� }d}| �|�r�t|ddd���}|D ]j}t�d|tj�rn|�d�d dd � �� }| � d |� d�� q�t�d|tj�r*| � d |� d �� q�q*W d � n1 s�0 Y dS )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�.r N� zMKRB5_TRACE=/dev/stdout kinit -k 'z$'z\s*id_provider\s*=\s*ipa�') �socketZgetfqdnZpath_isfile�open�re�match� IGNORECASE�split�upperr )r �hostnameZ sssd_conf�f�liner r r r + s( �� �� zKrb5.collect_kinit) �__name__� __module__�__qualname__�__doc__Z short_descZplugin_nameZprofilesr r r r r r r r s r c @ s e Zd ZdZdZdS )� RedHatKrb5)z krb5-libszkrb5-serverz/var/kerberos/krb5kdcN�r r! r"