Before I post I have search on internet and read manual for 2 days.
If the info I’m searching are easy to find I have missing it.
I’m on F38 workstation and have installed by dnf clamd.
I know that I can use clamscan on files etc but I need to use daemon to test it for my project.
To make the test I have download a virus signature file:
$ curl https://www.eicar.org/download/eicar.com.txt -o eicar.txt
daemon use socket connection:
$ sudo ls -l /run/clamd.scan/clamd.sock
srw-rw-rw-. 1 clamscan clamscan 0 23 nov 10.23 /run/clamd.scan/clamd.sock
the I try to test:
$ clamdscan eicar.txt
this fail to connect by my user permission on socket
I add my user to clamscan group … not work
use sudo to become root … not work
…
$ sudo -u clamscan -g leonardo clamdscan eicar.txt
All’utente leonardo non è consentito eseguire “/usr/bin/clamdscan eicar.txt” come clamscan:leonardo su …
tranlsate:
User leonardo is not allowed to run “/usr/bin/clamdscan eicar.txt” as clamscan:leonardo on …
Have I hit a selinux policy?
$ sudo -u clamscan -g clamscan clamdscan eicar.txt
ERROR: Can’t access file /home/leonardo/eicar.txt
Seems that if I use a good user by daemon is not good for eicar.txt
If I do:
$ sudo chmod o+x /home/leonardo
$ sudo chmod o+r eicar.txt
$ sudo -u clamscan -g clamscan ls -l eicar.txt
-rw-r–r–. 1 leonardo leonardo 103257 23 nov 08.42 eicar.txt
but:
$ sudo -u clamscan -g clamscan clamdscan eicar.txt
/home/leonardo/eicar.txt: File path check failure: Permission denied. ERROR
/home/leonardo/eicar.txt: File path check failure: Permission denied. ERROR----------- SCAN SUMMARY -----------
Infected files: 0
Total errors: 2
…
if I do:
sudo dnf diff /etc/clamd.d/scan.conf
I get:
— /etc/clamd.d/scan.conf 2023-10-29 02:00:00.000000000 +0200 [ === ] — B/s | 0 B --:-- ETA
+++ /etc/clamd.d/scan.conf 2023-11-15 13:58:21.753691180 +0100
@@ -94,6 +94,7 @@
# Path to a local socket file the daemon will listen on.
# Default: disabled (must be specified by a user)
#LocalSocket /run/clamd.scan/clamd.sock
+LocalSocket /run/clamd.scan/clamd.sock# Sets the group ownership on the unix socket.
# Default: disabled (the primary group of the user running clamd)
Have I do something wrong on my conf?
Anyone is able to do a simple scan using clamdscan?
I would like to let daemon run on clamscan user an group how is done by dnf default install.
I do not like put socket and daemon on root user.
(My english is bad. if too bad I will try to write this post on my lang let me know… )
best regards,
Leonardo