Hacked By AnonymousFox

Current Path : /opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/rpc/endpoints/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/rpc/endpoints/__pycache__/cleanup.cpython-311.pyc

�

��g�����dZddlmZddlmZmZddlmZddlm	Z	m
Z
mZddlm
Z
mZddlmZddlmZdd	lmZdd
lmZddlmZeeeg��Gd�d
e	����ZGd�de
��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 <https://www.gnu.org/licenses/>.

Copyright © 2019 Cloud Linux Software Inc.

This software is also available under ImunifyAV commercial license,
see <https://www.imunify360.com/legal/eula>
�)�MessageType)�AV�FULL)�feature)�CommonEndpoints�
RootEndpoints�bind)�&MS_CLEAN_REQUIRES_MYIMUNIFY_PROTECTION�check_permission)�validate_av_plus_license)�MalwareCleanupProxy)�restore_hits)�
MalwareHit)�MaliciousEndpointStatusc���eZdZeddd��edd�����Zeddd��edd�����Zeddd	��edd
�����ZdS)
�CleanupEndpoints�malware�	malicious�cleanupFNc���K�tt|��tj||d���}|r7|j�t
j|||������d{V��dSdS�NT��userr��hits�	initiator�
standard_only�rr
r�malicious_select�_sink�process_messager�MalwareCleanupTask)�self�idsrrrs     �Z/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/rpc/endpoints/cleanup.pyrzCleanupEndpoints.cleanup+s�����	�?��F�F�F��*�3�T�4�H�H�H���	��*�,�,��.��"�"/������
�
�
�
�
�
�
�
�
�	�	�zcleanup-allc���K�tt|��tj|d���}|r7|j�t
j|||������d{V��dSdSrr)r#rrrs    r%�cleanup_allzCleanupEndpoints.cleanup_all9s�����	�?��F�F�F��*��d�C�C�C���	��*�,�,��.��"�"/������
�
�
�
�
�
�
�
�
�	�	r&�restore-originalc��K�tj||d���}t||j���d{V��\}}t	||��S�NT)r�restore�rrrr r)r#r$rr�succeded�faileds      r%�restore_originalz!CleanupEndpoints.restore_originalGsW�����*�3�T�4�H�H�H��!-�d�D�J�!?�!?�?�?�?�?�?�?���&�&�x��8�8�8r&)FN�N)�__name__�
__module__�__qualname__r	rrr(r0�r&r%rr)s�������	�T�)�[�)�,�,��
�
�
���-�,�
�
�T�)�[�-�0�0��
�
�
���1�0�
�
�T�)�[�"4�5�5��9�9�9���6�5�9�9�9r&rc����eZdZ�fd�Zeddd��d���Zeddd��edd�����Zeddd	��ed
�����Z�xZ	S)�CleanupRootEndpointsc�p��t���|��t��|_dSr1)�super�__init__r
�_proxy)r#�sink�	__class__s  �r%r:zCleanupRootEndpoints.__init__Ps,���
���������)�+�+����r&rr�statusc��XK�|j���}|�ddi}nd|d�}d|iS)Nr>�stopped�running)r>�progress�items)r;�get_progress)r#rBr>s   r%�cleanup_statusz#CleanupRootEndpoints.cleanup_statusTsC�����;�+�+�-�-�����	�*�F�F� )�x�@�@�F��� � r&rFc����K��}tj|d���}|rJ|D]I��fd�|D��}|r5|j�t	j|�|������d{V���HdSdS)NTrc�*��g|]}|j�k�
|��Sr5)r)�.0�hitrs  �r%�
<listcomp>z5CleanupRootEndpoints.user_cleanup.<locals>.<listcomp>ds%���E�E�E�S�C�H��4D�4D�S�4D�4D�4Dr&r)rrr r!rr")r#rr�usersr�	user_hitss `    r%�user_cleanupz!CleanupRootEndpoints.user_cleanup]s���������*��t�D�D�D���
	��	
�	
��E�E�E�E�D�E�E�E�	����*�4�4�#�6�!*�&*�*7��������������	
	�
	�	
�	
r&r)c��K�tj|d���}t||j|���d{V��\}}t	||��Sr+r-)r#rrr.r/s     r%�user_restore_originalz*CleanupRootEndpoints.user_restore_originalnsW�����*��d�C�C�C��!-�d�D�J��!E�!E�E�E�E�E�E�E���&�&�x��8�8�8r&)F)
r2r3r4r:r	rErrMrO�
__classcell__)r=s@r%r7r7Os��������,�,�,�,�,�
�T�)�Y��)�)�!�!�*�)�!�
�T�)�V�Y�'�'��
�
�
���(�'�
�
�T�)�V�/�0�0��9�9���1�0�9�9�9�9�9r&r7N)�__doc__�"defence360agent.contracts.messagesr�,defence360agent.feature_management.constantsrr�)defence360agent.feature_management.lookupr� defence360agent.rpc_tools.lookuprrr	�%defence360agent.contracts.permissionsr
r�"defence360agent.rpc_tools.validater�imav.malwarelib.cleanup.cleanerr
�imav.malwarelib.cleanup.storager�imav.malwarelib.modelr�imav.malwarelib.utils.endpointsrrr7r5r&r%�<module>r\s~����*;�:�:�:�:�:�A�A�A�A�A�A�A�A�=�=�=�=�=�=�����������
��������H�G�G�G�G�G�?�?�?�?�?�?�8�8�8�8�8�8�,�,�,�,�,�,�C�C�C�C�C�C�	���d�V���"9�"9�"9�"9�"9��"9�"9���"9�J$9�$9�$9�$9�$9�=�$9�$9�$9�$9�$9r&

Hacked By AnonymousFox1.0, Coded By AnonymousFox