7f94084
Update 2021: Log to syslog is obsolete, journalctl superseded it
7f94084
50a490f
  By default, clamd provides a general "scan" service that requires minimal
50a490f
configuration.  To configure, edit /etc/clamd/scan.conf and:
cvsextras 47272f4
50a490f
  * set LocalSocket for localhost access or TCPSocket for network access.
cvsextras 47272f4
50a490f
  Default configuration will:
50a490f
50a490f
  * Log to syslog
50a490f
  * Run as the user "clamscan"
Enrico Scholz 55b25f1
Enrico Scholz 55b25f1
  When LogFile feature is wanted, it must be writable for the assigned
50a490f
User.  The recommended way is to:
50a490f
cvsextras 47272f4
  * make it owned by the User's *group*
cvsextras 47272f4
  * assign at least 0620 (u+rw,g+w) permissions
cvsextras 47272f4
cvsextras 47272f4
  A suitable command might be
cvsextras 47272f4
  | # touch <logfile>
cvsextras 47272f4
  | # chgrp <user> <logfile>
cvsextras 47272f4
  | # chmod 0620   <logfile>
Enrico Scholz 55b25f1
  | # restorecon <logfile>
cvsextras 47272f4
50a490f
  NEVER use 'clamav' as the user since it can modify the database.  This is
50a490f
the user who is running the application; e.g. for mimedefang
50a490f
(http://www.roaringpenguin.com/mimedefang), the user might be 'defang'.
50a490f
Theoretically, distinct users could be used, but it must be made sure that
50a490f
the application-user can write into the socket-file, and that the clamd-user
50a490f
can access the files asked by the application to be checked.
50a490f
50a490f
  The default service can be enabled and started with:
50a490f
50a490f
  systemctl enable clamd@scan.service
50a490f
  systemctl start clamd@scan.service
50a490f
50a490f
  To create other individual clamd-instances take the following files in
50a490f
/usr/share/doc/clamd/ and modify/copy them in the suggested way:
50a490f
50a490f
clamd.conf, copy to /etc/clamd.d/<SERVICE>.conf
50a490f
  * Change <SERVICE> as to match name of config file
50a490f
  * Any other changes as noted above
cvsextras 47272f4
Enrico Scholz 55b25f1
clamd.logrotate: (only when LogFile feature is used)
cvsextras 47272f4
  * set the correct value for the logfile
cvsextras 47272f4
  * place it into /etc/logrotate.d
cvsextras 47272f4
50a490f
  Additionally, when using LocalSocket instead of TCPSocket, the directory
50a490f
for the socket file must be created.  For tmpfiles based systems, you might
50a490f
want to create a file /etc/tmpfiles.d/clamd.<SERVICE>.conf with a content of
cvsextras 47272f4
234a5b8
 | d /run/clamd.<SERVICE> <MODE> <USER> <GROUP>
cvsextras 47272f4
50a490f
  Adjust <MODE> (0710 should suffice for most cases) and <USER> + <GROUP>
50a490f
so that the socket can be accessed by clamd and by the applications using
50a490f
clamd. Make sure that the socket is not world accessible; else, DOS attacks
50a490f
or worse are trivial.
cvsextras 47272f4
50a490f
  After emulating these steps by hand (or else rebooting), you still need set
8ee8f46
SELinux:
8ee8f46
234a5b8
 chcon -t clamd_var_run_t /run/clamd.<SERVICE>
8ee8f46
or
234a5b8
 restorecon -R -v "/run/clamd.<SERVICE>"
8ee8f46
8ee8f46
More SELinux notes:
8ee8f46
you may need run:
8ee8f46
8ee8f46
 setsebool -P antivirus_can_scan_system 1
8ee8f46
8ee8f46
and also maybe this one (I need to confirm that is obsolete)
8ee8f46
8ee8f46
 setsebool -P antivirus_use_jit 1
cvsextras 47272f4
50a490f
  The new service can be enabled and started with:
50a490f
50a490f
  systemctl enable clamd@<SERVICE>.service
50a490f
  systemctl start clamd@<SERVICE>.service
50a490f
50a490f
cvsextras 47272f4
[Disclaimer:
cvsextras 47272f4
 this file and the script/configfiles are not part of the official
cvsextras 47272f4
 clamav package.
cvsextras 47272f4
cvsextras 47272f4
 Please send complaints and comments to
50a490f
 https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=clamav]