m`E{S
d Z ddlZddlmZ ddlmZ ddlmZmZ ddl m
Z
ddlmZ ddl
mZ ej e Zd ed
edefdZd
ededededef
dZ G d 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 .
Copyright © 2019 Cloud Linux Software Inc.
This software is also available under ImunifyAV commercial license,
see
NPath) HookEvent)MessageSinkexpect)MalwareScanType)panel_users)notifierevent_iduserbodyc K t j | || d {V d S # t $ r'}t d| | Y d }~d S d }~ww xY w)Nz#Failed to trigger an event '%s': %r)r
trigger_event Exceptionloggererror)r r r
es M/opt/imunify360/venv/lib/python3.11/site-packages/imav/plugins/event_hooks.pyr r " s I$XtT::::::::::: I I I:HaHHHHHHHHHIs "
AAApathscan_id scan_typecustom_event_id
user_event_idc K |t j k rd}|}nM|t j t j fv r1t fdt d {V D d }|}nd S t
||| d| d {V d S )N c 3 t K | ]2}t t |d k (|d V 3dS )homer Nr ).0ur s r z%trigger_scan_event..6 sN
::ai00 & 0000
)r r )r ON_DEMAND
BACKGROUNDUSERnextr r )r r r r r kwargsr r s ` r trigger_scan_eventr' ) s O---" 1?3GH H H
*}},,,,,,
!
T44V4 r! c e Zd Zd Z eej d Z eej d Z eej
d ZdS )
EventHooksc K || _ d S )N)_loop)selfloops r create_sinkzEventHooks.create_sinkI s
r! c < K |d }|t j t j t j fv r
t j }n)|t j t j fv r
t j }nd S d |d D }|D ]!}t ||d|d i d {V "d S )Nr c h | ]
}|d S )username )r hits r z+EventHooks.malware_found..[ s :::SZ:::r! DUMPr )
r r" RESCANRESCAN_OUTDATEDr
"CUSTOM_SCAN_MALWARE_FOUND_EVENT_IDr# r$ USER_SCAN_MALWARE_FOUND_EVENT_IDr )r, eventr r usersr s r
malware_foundzEventHooks.malware_foundL s +& %"+
BHH
?57KL
L
L@HHF::E&M::: O OD$E)