In our server (CentOS7 & WHM/cPanel) we try to scan uploaded files using Imunify360, its working fine using root user privileges, but using normal user we get this python Traceback:
/usr/bin/imunify-antivirus malware on-demand start --path /home/foo/public_html/upload/test.pdf
> Traceback (most recent call last):
> File "/usr/bin/imunify-antivirus", line 11, in <module>
> load_entry_point(imunify-antivirus==1.0, console_scripts, imunify-antivirus)()
> File "/opt/alt/python38/lib/python3.8/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
> return get_distribution(dist).load_entry_point(group, name)
> File "/opt/alt/python38/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
> return ep.load()
> File "/opt/alt/python38/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2443, in load
> return self.resolve()
> File "/opt/alt/python38/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in resolve
> module = __import__(self.module_name, fromlist=[__name__], level=0)
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/cli.py", line 23, in <module>
> from defence360agent import defence360, rpc_handlers
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/rpc_handlers.py", line 32, in <module>
> from defence360agent.malwarelib.rpc.endpoints.base import (
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/malwarelib/rpc/endpoints/__init__.py", line 22, in <module>
> from . import base
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/malwarelib/rpc/endpoints/base.py", line 51, in <module>
> from defence360agent.malwarelib.plugins.scan_queue import QueueSupervisorSync
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/malwarelib/plugins/scan_queue.py", line 65, in <module>
> class QueueSupervisorSync:
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/malwarelib/plugins/scan_queue.py", line 66, in QueueSupervisorSync
> queue = ScanQueue()
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/malwarelib/scan/queue.py", line 201, in __init__
> self._scans: Deque[QueuedScan] = unserialize(
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/utils/serialization.py", line 76, in unserialize
> with open(path, "rb") as r:
> PermissionError: [Errno 13] Permission denied: /var/imunify360/aibolit/scans.pickle
My question is how to scan a file using non sudo users?
/usr/bin/imunify-antivirus malware on-demand start --path /home/foo/public_html/upload/test.pdf
> Traceback (most recent call last):
> File "/usr/bin/imunify-antivirus", line 11, in <module>
> load_entry_point(imunify-antivirus==1.0, console_scripts, imunify-antivirus)()
> File "/opt/alt/python38/lib/python3.8/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
> return get_distribution(dist).load_entry_point(group, name)
> File "/opt/alt/python38/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
> return ep.load()
> File "/opt/alt/python38/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2443, in load
> return self.resolve()
> File "/opt/alt/python38/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in resolve
> module = __import__(self.module_name, fromlist=[__name__], level=0)
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/cli.py", line 23, in <module>
> from defence360agent import defence360, rpc_handlers
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/rpc_handlers.py", line 32, in <module>
> from defence360agent.malwarelib.rpc.endpoints.base import (
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/malwarelib/rpc/endpoints/__init__.py", line 22, in <module>
> from . import base
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/malwarelib/rpc/endpoints/base.py", line 51, in <module>
> from defence360agent.malwarelib.plugins.scan_queue import QueueSupervisorSync
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/malwarelib/plugins/scan_queue.py", line 65, in <module>
> class QueueSupervisorSync:
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/malwarelib/plugins/scan_queue.py", line 66, in QueueSupervisorSync
> queue = ScanQueue()
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/malwarelib/scan/queue.py", line 201, in __init__
> self._scans: Deque[QueuedScan] = unserialize(
> File "/opt/alt/python38/lib/python3.8/site-packages/defence360agent/utils/serialization.py", line 76, in unserialize
> with open(path, "rb") as r:
> PermissionError: [Errno 13] Permission denied: /var/imunify360/aibolit/scans.pickle
My question is how to scan a file using non sudo users?
Comment