Hacked By AnonymousFox
�
��g�D � �� � d Z ddlZddlZddlZddlZddlZddlmZ ddlmZ ddl m
Z
mZ ddlm
Z
mZ ddlmZ ddlmZ dd lmZmZ dd
lmZmZmZ ddlmZ ddlmZ dd
lmZ ddl m!Z!m"Z"m#Z# ddl$m%Z% ddl&m'Z' ddl(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z. ddl/m0Z0m1Z1m2Z2 ddl3m4Z4m5Z5m6Z6 ddl7m8Z8 ddl9m:Z: ddl;m<Z= ddl>m?Z? ddl@mAZA ddlBmCZC ddlDmEZEmFZFmGZG ejH eI� � ZJ edg d�d�� � ZK G d� d e"� � ZL G d!� d"e!� � ZMd#eNeOeOf fd$�ZP eeeeg� � G d%� d&e!� � � � ZQ G d'� d(e"� � ZR G d)� d*e"� � ZS G d+� d,e"� � ZTdS )-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>
� N)�
namedtuple)�partial)�List�Sequence)�Malware�UserType)�LicenseError)�MessageType)�MS_IGNORE_LIST_EDIT�check_permission)�AV� AV_REPORT�FULL)�feature)�db)�run_in_executor)�CommonEndpoints�
RootEndpoints�bind)�run_in_executor_decorator)�ValidationError)�Scope�does_path_belong_to_user�get_path_owner�get_results_iterable_expression�is_cloudways�safe_fileops)�MalwareHitStatus�MalwareScanResourceType�MalwareScanType)�MalwareHistory�
MalwareHit�MalwareIgnorePath)�
split_args��get_crontab)�QueueSupervisorSync)�
MalwareAction)� user_list)�MaliciousEndpointStatus)�FALSE_NEGATIVE�FALSE_POSITIVE�submit_malware�IgnoreParameters)�path�app_name�db_host�db_port�db_name)NNNNN)�defaultsc �v � e Zd Zej ZdZ edd� � dd�� � Z edd� � d� � � Z dS ) �SubmitEndpointsu� Warning: This server’s security can be enhanced by enabling the MALWARE_SCANNING.sends_file_for_analysis option. This may minimize the number of undetected malware, making your system more resistant to new threats.
The command below can be used to enable the option:
imunify-antivirus config update '{"MALWARE_SCANNING": {"sends_file_for_analysis": true}}'
- or -
imunify360-agent config update '{"MALWARE_SCANNING": {"sends_file_for_analysis": true}}'
�submitzfalse-positiveNc � �� K � t |t |�� � � d {V �� d S # t $ r}t |� � �d }~wt $ r# t d� |� � � � �w xY w)N)�reason�File {} doesn't exist.)r- r, r r �FileNotFoundError�format)�self�filenamer9 �scanner�es �W/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/rpc/endpoints/base.py� submit_fpzSubmitEndpoints.submit_fpk s� � � � � M� ��>�&�I�I�I�I�I�I�I�I�I�I�I�I��� %� %� %�!�!�$�$�$����� � M� M� M�!�":�"A�"A�(�"K�"K�L�L�L� M���s �# �
A,�<�0A,zfalse-negativec � �$ K � t |t � � � d {V �� t j st j | j � � S d S # t $ r}t |� � �d }~wt $ r# t d�
|� � � � �w xY w)Nr: )r- r+ r �
SEND_FILES�warnings�warn�_SEND_FILES_DISABLED_BANNERr r r; r<