�
i��d� � �4 � d dl mZmZmZmZ G d� dee� Zy)� )�Plugin�IndependentPlugin�SoSPredicate� PluginOptc �D � e Zd ZdZdZdZ eddd�� gZdZd Z d
� Z
d� Zy)
� LibreswanzLibreswan IPsec� libreswan)�network�security� openshift�
ipsec-barfFzcollect ipsec barf output)�default�desc)�/etc/ipsec.conf)r �openswanc � � | j g d�� | j g d�� t | ddgddi�� }| j dd g|�
� | j d� r| j d� | j g d
�� y )N)r z/etc/ipsec.dz/proc/net/xfrm_stat)zipsec verifyzipsec whack --statuszipsec whack --listallzcertutil -L -d sql:/etc/ipsec.d� xfrm_user� xfrm_algo�kmods�all)r �requiredzip xfrm policyz
ip xfrm state)�predr
z
ipsec barf)z/etc/ipsec.secretsz/etc/ipsec.secrets.dz/etc/ipsec.d/*.dbz/etc/ipsec.d/*.secrets)�
add_copy_spec�add_cmd_outputr �
get_option�add_forbidden_path)�self� xfrm_preds �>/usr/lib/python3/dist-packages/sos/report/plugins/libreswan.py�setupzLibreswan.setup s� � ����
� �
���
� � !��k�;�-G�+2�E�*:�<� ������
� � � �
�?�?�<�(�����-���� !
� � c �x � d}| j d|d� | j d� r| j d|d� y y )Nz/(aead|auth|auth-trunc|enc)(\s.*\s)(0x[0-9a-f]+)�statez\1\2********r
�barf)�do_cmd_output_subr )r �xfrm_state_regexps r �postproczLibreswan.postproc@ sI � �5�����w�(9�.� 0� �?�?�<�(��"�"�6�+<�#2�
4� )r! N)�__name__�
__module__�__qualname__�
short_desc�plugin_name�profilesr �option_list�files�packagesr r' |