File clamd-README of Package clamav (Revision 64d5ac9271920a1e0ef1cb035c8cc4a7)
Currently displaying revision 64d5ac9271920a1e0ef1cb035c8cc4a7 , Show latest
60
1
To create individual clamd-instance take the following files and
2
modify/copy them in the suggested way:
3
4
clamd.conf:
5
* set LocalSocket (or better: TCPSocket) and User to suitable values;
6
avoid PidFile unless it is required by system monitoring or something
7
else. Logging through syslog is usually better than an individual
8
Logfile.
9
* place this file into /etc/clamd.d with an unique service-name;
10
e.g. as /etc/clamd.d/<SERVICE>.conf
11
12
When using TCPSocket, create iptables rules which are limiting the
13
access by source and/or by using '-m owner'.
14
15
When LogFile feature is wanted, it must be writable for the assigned
16
User. Recommended way to reach this, is to:
17
* make it owned by the User's *group*
18
* assign at least 0620 (u+rw,g+w) permissions
19
20
A suitable command might be
21
| # touch <logfile>
22
| # chgrp <user> <logfile>
23
| # chmod 0620 <logfile>
24
| # restorecon <logfile>
25
26
NEVER use 'clamav' as the user since he can modify the database.
27
This is the user who is running the application; e.g. for mimedefang
28
(http://www.roaringpenguin.com/mimedefang), the user might be
29
'defang'.Theoretically, distinct users could be used, but it must be
30
made sure that the application-user can write into the socket-file,
31
and that the clamd-user can access the files asked by the
32
application to be checked.
33
34
clamd.logrotate: (only when LogFile feature is used)
35
* set the correct value for the logfile
36
* place it into /etc/logrotate.d
37
38
clamd@<SERVICE>.service: (systemd instance)
39
* instance of clamd@.service
40
41
Additionally, when using LocalSocket instead of TCPSocket, the directory
42
for the socket file must be created. For tmpfiles based systems, you
43
might want to create a file /usr/lib/tmpfiles.d/clamd.<SERVICE>.conf
44
with a content of
45
46
| d /var/run/clamd.<SERVICE> <MODE> <USER> <GROUP>
47
48
Adjust <MODE> (0710 should suffice for most cases) and <USER> + <GROUP>
49
so that the socket can be accessed by clamd and by the applications
50
using clamd. Make sure that the socket is not world accessible; else,
51
DOS attacks or worse are trivial.
52
53
54
[Disclaimer:
55
this file and the script/configfiles are not part of the official
56
clamav package.
57
58
Please send complaints and comments to
59
mailto:enrico.scholz@informatik.tu-chemnitz.de!]
60