3b d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m
Z
mZmZ ddl
mZ ddlmZ dd lmZ dd
lmZ eej d Z G d
de
e 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
)partial)Dict)
inactivity)MessageType)MessageSink
MessageSourceexpect)MalwareHitStatus)
MalwareHit)
MalwareAction)Scopestatus) attributec j e Zd ZdZej Zd Zd Zd Z e
ej de
fd ZdS )RestoreFromBackupPluginz5A plugin that handles RestoreFromBackupTask messages.c $ d\ | _ | _ d S )N)NN)_loop_sink)selfs U/opt/imunify360/venv/lib/python3.11/site-packages/imav/plugins/restore_from_backup.py__init__z RestoreFromBackupPlugin.__init__- s !+
DJJJ c K || _ d S N)r )r loops r create_sinkz#RestoreFromBackupPlugin.create_sink0
r c K || _ d S r )r )r r sinks r
create_sourcez%RestoreFromBackupPlugin.create_source3 r r messagec T K | d }|sdS | d }t j |t j t
j d 5 i }| |g | g g }}|
D ]\ }}t j ||| j
d{V }| d |
D | d |
D t j | t | } |
D ]\ }
}t j ||
ddd dS # 1 swxY w Y dS )a Restores hits in RestoreFromBackupTask message from backup.
- sets restore_from_backup_started status for received hits in
the database.
- successfully restored files are removed from the database.
- statuses in the database are reverted from
restore_from_backup_started to its original value for files that
failed to restore.
hitsN initiatorrestore_from_backup)r# r$ r c &