
    -_g                     ,    d dl mZmZ  G d dee      Zy)    )PluginUbuntuPluginc                   0    e Zd ZdZdZdZdZdZdZd Z	d Z
y)	VaultzThe Vault plugin collects the current status of the vault
    snap on a Ubuntu machine.

    It will collect logs from journal, vault status and configuration
    z3Manage access to secrets and protect sensitive datavault)sysmgmtsecurity)r   c                    d}| j                  |       	 t        |dd      5 }|j                         j                         D ]V  }|s|j	                  d      }|d   j                         dk(  s.|d   j                  d	      }| j                  d
d|i       X 	 d d d        y # 1 sw Y   y xY w# t        $ r!}| j                  d| d|        Y d }~y d }~ww xY w)N /var/snap/vault/common/vault.hclrzUTF-8)encoding=r   api_addr   z" zvault status
VAULT_ADDR)envzCould not open conf file z: )	add_copy_specopenread
splitlinessplitstripadd_cmd_outputIOError
_log_error)self	vault_cfgcfilelinewordsr   errors          :/usr/lib/python3/dist-packages/sos/report/plugins/vault.pysetupzVault.setup   s    6	9%	Niw7 J5!JJL335 JD  JJsOEQx~~':5#(8>>%#8++N1=x0H , JJJ J J  	NOO7	{"UGLMM	Ns;   B1 AB%0+B%B1 %B.*B1 .B1 1	C:CCc                 *    | j                  ddd       y )Nr   z(password\s?=\s?).*z\1******)do_file_sub)r   s    r"   postproczVault.postproc/   s    ."	
    N)__name__
__module____qualname____doc__
short_descplugin_nameprofilesservicespackager#   r&    r'   r"   r   r      s.     GJK&HHGN&
r'   r   N)sos.report.pluginsr   r   r   r1   r'   r"   <module>r3      s    4&
FL &
r'   