403Webshell
Server IP : 65.1.209.187  /  Your IP : 216.73.216.144
Web Server : nginx/1.24.0
System : Linux ip-172-31-5-206 6.14.0-1015-aws #15~24.04.1-Ubuntu SMP Tue Sep 23 22:44:48 UTC 2025 x86_64
User :  ( 1001)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/sos/report/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

([Qh���<�ddlZddlZddlmZmZGd�dee�Zy)�N)�Plugin�UbuntuPluginc�0�eZdZdZdZdZdZdZdZd�Z	d�Z
y)	�Microk8saThe Microk8s plugin collects the current status of the microk8s
    snap on a Ubuntu machine.

    It will collect logs from journald related to the snap.microk8s
    units as well as run microk8s commands to retrieve the configuration,
    status, version and loaded plugins.
    zThe lightweight Kubernetes�microk8s)�	container)rc���|jd��gd�}|jd�|j|D�cgc]}|j�d|����c}�d}|�d�}|jd|�d	��d}|j	|d
��|j|�d�|�d
�|�d�g�d}|�d�}|�d�}|�d
�}	|�d|�d|�d|	�d�}
ddd�ddgdd�ddd�g}	t|	dd��5}|j
�}
tjd|
�}|D]}|jd|��d |��dgd!��� 	ddd�|D]t}|
}|jd$g�}|D]	}|�d|��}�tj|jd%��}|jd&�}|j|�d|��d'|�����vycc}w#1swY��xYw#t$r!}|jd"|	�d#|���Yd}~��d}~wwxYw)(Nzsnap.microk8s.*)�units)zaddons repo list�configzctr plugins lszctr plugins ls -d�status�version�4/var/snap/microk8s/current/credentials/client.config� z1/var/snap/microk8s/current/var/kubernetes/backendz/cluster.crtzopenssl x509 -in z -noout -dates�ls_microk8s_dqlite_dir)�suggest_filenamez
/info.yamlz
/cluster.yamlz/failure-domainz!/snap/microk8s/current/bin/dqlitez/cluster.keyz -c z -k z -s file://z k8sz.cluster)�query�suggested_file_suffixz-f jsonz.cluster_-f_json)r�optsrz.leader�rzutf-8)�encodingz#Address:\s*(\d+\.\d+\.\d+\.\d+:\d+)z
.describe z
.describe_)rrrzFailed to parse z: rrr�
microk8s_sql_)�add_journal�
add_copy_spec�add_cmd_output�microk8s_cmd�add_dir_listing�open�read�re�findall�append�	Exception�	add_alert�get�json�dumps)�self�microk8s_subcmds�subcmd�crt_dir�
dqlite_crt�db_path�
dqlite_bin�cert�key�servers�
dqlite_cmd�queries�cluster_definition�cluster�nodes�node�e�query_entry�sql_cmdr�optr�file_suffixs                       �=/usr/lib/python3/dist-packages/sos/report/plugins/microk8s.py�setupzMicrok8s.setup"s������0��1�
��	
���B�	
�	
���:J�
�06�t� � �!��6�(�+�
�	�F���y��-�
�����
�|�>�:�	
�F��	
����5�	�	
�
	
����i�z�"��i�}�%��i��'�
�	�9�
���,�'���	��&���I�]�+��"�|�4��v�T�#��k�'��$�O�
�$�)3�
�
$�"��);�
�#�)2�
�
�� 	>��g�s�W�5�
�9K�,�1�1�3���
�
�:�G���"��D��N�N�#-�d�V�!4�3=�d�V�1D�!*��$���

� #�	�K� �G��?�?�6�2�.�D��
-��$�I�Q�s�e�,��
-��J�J�{���w�7�8�E�%�/�/�*A�B�K�����)�1�U�G�$�#0��
�!>�
 �
�	��A
�`
�
���	>��N�N�-�g�Y�b���<�=�=��	>�s6�F/�G�"A
F4�-G�4F=�9G�	G*�	G%�%G*c��d}|j|j|d�gd�}ddj|��d�}|jd|d�y)	Nz((certificate-authority-data:|token:)\s.*z\1 "**********")zcertificate-authority-datazclient-certificate-datazclient-key-data�tokenz(^\s*(�|z
)\s*:\s*)(.*)rz\1*********)�do_cmd_output_subr�join�do_path_regex_sub)r'�rsub�protect_keys�	key_regexs    r<�postproczMicrok8s.postproc~sW��:�����t�0�0�$�8J�K�
���c�h�h�|�4�5�]�C�	����B��~�	
�N)�__name__�
__module__�__qualname__�__doc__�
short_desc�plugin_name�profiles�packagesrr=rG�rHr<rrs.���.�J��K��H��H��L�Z�x
rHr)r%r�sos.report.pluginsrrrrQrHr<�<module>rSs ���	�3�}
�v�|�}
rH

Youez - 2016 - github.com/yon3zu
LinuXploit