j*I d Z ddlZddlZddlZddlmZ ddlmZmZ ddl m
Z
ddlmZ ddl
mZ ej e Z G d d ZdS )
u
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License,
or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Copyright © 2019 Cloud Linux Software Inc.
This software is also available under ImunifyAV commercial license,
see
N)suppress)MalwareMalwareSignatures)MDS_PATH)MDSDetachedCleanupDir)storage_pathc F e Zd Zd Zed Zed Zd ZdS )MalwareDatabaseCleanerc |st d |st d || _ || _ || _ t | j | _ d S )Nz'Cannot instantiate cleaner without pathz,Cannot instantiate cleaner without app names)
ValueError
cleanup_idpathapp_namer work_dir)selfr
r r s U/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/scan/mds/cleaner.py__init__zMalwareDatabaseCleaner.__init__$ s\ HFGGG MKLLL$
-do>>
c 6 t | j | j S )N)r r r r s r r z#MalwareDatabaseCleaner.storage_path. s DIt}555r c dt dd| j dt j dt | j j d| j dt | j j d| j d | j
d
t j dt t j
gS )Nz/opt/ai-bolit/wrapperz--cleanz--pathz--avdbz
--report-filez
--detachedz
--progressz
--backup-filez
--app-namez --procudbz--db-timeout)r r r MDS_AI_BOLIT_HOSTERstrr report_filer
progress_filer r MDS_PROCU_DBr MDS_DB_TIMEOUTr s r cmdzMalwareDatabaseCleaner.cmd2 s
$I1
)**O
+,,M*&''+
r c V K | j 5 | j j d 5 }| j j d 5 }t d| j t t 5 t j
| j d d d n# 1 swxY w Y t j
| j d||t | j d d {V d d d n# 1 swxY w Y d d d n# 1 swxY w Y d d d d S # 1 swxY w Y d S )Nw)modezRunning MDS Cleaner with: %sT)start_new_sessionstdoutstderrcwd)r log_fileopenerr_fileloggerinfor r FileNotFoundErrorosunlinkr asynciocreate_subprocess_execr )r l_fe_fs r startzMalwareDatabaseCleaner.startL s9
] ',, -
dm,11s1;;
?B:DHEEE/00 1 1Id/0001 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4X&*DM**
s| !D!D5C/B' C/'B+
+C/.B+
/4C/#D/C33D6C37D:DD
D
D
DD"%D"N)__name__
__module____qualname__r propertyr r r2 r r r
r
# sh ? ? ? 6 6 X6
X
2 r r
)__doc__r. loggingr,
contextlibr defence360agent.contracts.configr r imav.malwarelib.scan.mdsr !imav.malwarelib.scan.mds.detachedr imav.malwarelib.scan.mds.restorer getLoggerr3 r) r
r7 r r r@ s * G G G G G G G G - - - - - - C C C C C C 9 9 9 9 9 9 8 $ $9 9 9 9 9 9 9 9 9 9r