관리-도구
편집 파일: notifier.cpython-311.pyc
� IMgI � � � d Z ddlZddlZddlZdZdZdZdZdZdZ d Z d ZdZdZ d ZdZdedededefd�Zdeddfd�Zdedededdfd�Zdd�ZdS )z$Send events via Notification service� Nz/opt/imunify360/lib/event.sockg $@� i �CONFIG_UPDATED�USER_SCAN_STARTED�USER_SCAN_FINISHED�USER_SCAN_MALWARE_FOUND�CUSTOM_SCAN_STARTED�CUSTOM_SCAN_FINISHED�CUSTOM_SCAN_MALWARE_FOUND�SCRIPT_BLOCKED�event_id�user�body�returnc �� � t j | |t j t j |� � � d� � � � � d� � d�� � }|� d� � }t |� � t k r5t d� t |� � t � � � � �t |� � � t d�� � |z S )Nzutf-8)r r r z#message size {} exceeds limit of {}�big)� byteorder)�json�dumps�base64� b64encode�encode�decode�len� _MAX_SIZE� Exception�format�to_bytes� _LEN_BYTES)r r r �event�binarys �T/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/subsys/notifier.py�_prepare_eventr"