$('H6| d Z ddlZddlZddlZddlZddlZddlmZ ddlZ ddl
mZmZ ddl
mZ ddlmZ ddlmZ ddlmZ dd lmZ dd
lmZ ddlmZ ddlmZ ee ee cZZ G d
de Z G d de Z!dS )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
Generic Sensor plugin
- Creates listening unix domain socket on config.GenericSensor.SOCKET_PATH
- Expects alert data formatted as
N) getLogger) SimpleRpcGENERIC_SENSOR_SOCKET_PATH)MessageType)Sensor)UnixSocketAuthProtocol)g)getNetworkLogger)RpcServerAV)Scope)
LineBufferc e Zd Zej ej ej ej ej ej ej
ej dZd Z
fdZd Zd Zd Zd Z xZS )Protocol)NOOPMALWARE_SCANMALWARE_SCAN_TASKMALWARE_SCAN_COMPLETEMALWARE_CLEAN_COMPLETEMALWARE_RESTORE_COMPLETEMALWARE_CHECK_DETACHED_SCANSMALWARE_SEND_FILESc V || _ || _ t | _ d | _ d S N)_loop_sinkr
_line_buffer transport)selfloopsink_s P/opt/imunify360/venv/lib/python3.11/site-packages/imav/plugins/generic_sensor.py__init__zProtocol.__init__G s'
&LL c t | nY# t t t j f$ r:}t d| | Y d }~d S d }~ww xY w| j dk rBt d| j | j
| j | d S || _ t
d d S )Nz@Rejected generic_sensor connection: SO_PEERCRED unavailable (%s)r zJRejected generic_sensor connection from non-root peer uid=%d gid=%d pid=%dzConnection made)superconnection_madeOSErrorAttributeErrorstructerrornetwork_loggerwarningclose_uid_gid_pidr debug)r r exc __class__s r" r' zProtocol.connection_madeM s GG##I....6 ""/
OOFFFFF 9>>""'
OOF"./////s !% A;/A66A;c | j d S | }| st d| d S | j | | j D ]s}|rot d | |
| }|r+t j |d<