X7ROOT File Manager
Current Path:
/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/plugins
opt
/
imunify360
/
venv
/
lib
/
python3.11
/
site-packages
/
imav
/
malwarelib
/
plugins
/
π
..
π
__init__.py
(0 B)
π
__pycache__
π
aibolit_result_scan.py
(5.26 KB)
π
cleanup.py
(28.74 KB)
π
cleanup_revert.py
(2.47 KB)
π
detached_scan.py
(10.72 KB)
π
imunify_patch_subscription.py
(3.64 KB)
π
malware_response.py
(3.82 KB)
π
mrs_uploader.py
(6.03 KB)
π
patch_vulnerabilities.py
(7.91 KB)
π
remote_patch_revert.py
(2.61 KB)
π
scan_queue.py
(2.32 KB)
π
scanner.py
(4.11 KB)
π
schedule_watcher.py
(4.29 KB)
π
store.py
(19.73 KB)
π
store_vulnerabilities.py
(5.24 KB)
Editing: scan_queue.py
""" 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> """ import logging from defence360agent.contracts.messages import MessageType from defence360agent.contracts.plugins import ( MessageSink, MessageSource, expect, ) from imav.malwarelib.scan.queue_supervisor_sync import ( QueueSupervisorSync, ) logger = logging.getLogger(__name__) class QueueSupervisor(MessageSink, MessageSource): supervisor = loop = sink = None async def create_sink(self, loop): self.loop = loop async def create_source(self, loop, sink): supervisor = QueueSupervisorSync(loop=loop, sink=sink) QueueSupervisor.supervisor = supervisor QueueSupervisor.loop = loop QueueSupervisor.sink = sink # If the loop was broken (e.g. after restarting the application) await sink.process_message(MessageType.MalwareScanQueueRecheck()) @expect(MessageType.MalwareScanQueuePut) async def put(self, message): await self.supervisor.put(message.paths, **message.scan_args) @expect(MessageType.MalwareScanQueueRemove) async def remove(self, message): self.supervisor.remove(message.scan_ids) @expect(MessageType.MalwareScanQueueRecheck) async def next(self, message): self.supervisor.recheck() @expect(MessageType.MalwareScanQueueStopBackground) async def stop_background(self, message): self.supervisor.clear_background() @expect(MessageType.MalwareScanQueueUpdateStatus) async def update_scan_status(self, message): await self.supervisor.update_scan_status( message.scan_ids, message.status )
Upload File
Create Folder