3 ܓi@s&ddlmZmZGdddeeZdS))Plugin UbuntuPluginc@s4eZdZdZdZdZd Zd Zd ZddZ dd Z d S)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 datavaultsysmgmtsecuritycCsd}|j|ytt|ddd\}xT|jjD]D}|s8q.|jd}|djdkr.|djd }|jd d |id q.WWdQRXWn8tk r}z|jd |d|WYdd}~XnXdS)Nz /var/snap/vault/common/vault.hclrzUTF-8)encoding=rapi_addrz" z vault statusZ VAULT_ADDR)envzCould not open conf file z: ) Z add_copy_specopenread splitlinessplitstripZadd_cmd_outputIOErrorZ _log_error)selfZ vault_cfgcfilelineZwordsr errorr/usr/lib/python3.6/vault.pysetups  z Vault.setupcCs|jddddS)Nz /var/snap/vault/common/vault.hclz(password\s?=\s?).*z\1******)Z do_file_sub)rrrrpostproc/szVault.postprocN)rr)r)r) __name__ __module__ __qualname____doc__Z short_descZ plugin_nameZprofilesZservicespackagerrrrrrrsrN)Zsos.report.pluginsrrrrrrr s