Bug 868456 - SELinux is preventing freshclam from search access on the directory amavisd.
SELinux is preventing freshclam from search access on the directory amavisd.
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-19 18:48 EDT by Matt Kinni
Modified: 2012-12-20 10:05 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-20 10:05:08 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matt Kinni 2012-10-19 18:48:35 EDT
Description of problem:
If the "NotifyClamd" option is specified in /etc/freshclam.conf like so:

# Send the RELOAD command to clamd.
# Default: no
NotifyClamd /etc/clamd.d/amavisd.conf

Then when freshclam downloads new virus signatures it tells clamd to reload the signature database via /var/spool/amavisd/clamd.sock.  However, SELinux prevents it from going into the directory /var/spool/amavisd:
############################

SELinux is preventing freshclam from search access on the directory amavisd.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that freshclam should be allowed search access on the amavisd directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep freshclam /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:freshclam_t:s0-s0:c0.c1023
Target Context                system_u:object_r:amavis_spool_t:s0
Target Objects                amavisd [ dir ]
Source                        freshclam
Source Path                   freshclam
Port                          <Unknown>
Host                          example.com
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.10.0-153.fc17.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     example.com
Platform                      Linux example.com 3.6.1-1.fc17.i686.PAE #1 SMP Wed
                              Oct 10 12:32:58 UTC 2012 i686 i686
Alert Count                   1
First Seen                    2012-10-19 11:03:45 CEST
Last Seen                     2012-10-19 11:03:45 CEST
Local ID                      7cd33e5b-7a71-4f3d-b09c-c4358e7f9fb2

Raw Audit Messages
type=AVC msg=audit(1350637425.376:111): avc:  denied  { search } for  pid=1419 comm="freshclam" name="amavisd" dev="vda1" ino=138131 scontext=system_u:system_r:freshclam_t:s0-s0:c0.c1023 tcontext=system_u:object_r:amavis_spool_t:s0 tclass=dir


Hash: freshclam,freshclam_t,amavis_spool_t,dir,search

audit2allow

#============= freshclam_t ==============
allow freshclam_t amavis_spool_t:dir search;

audit2allow -R

#============= freshclam_t ==============
allow freshclam_t amavis_spool_t:dir search;
############################

Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.10.0-153.fc17.noarch

How reproducible:
always

Steps to Reproduce:
1. install clamav-update, add the notifyclamd option in /etc/freshclam.conf
2. wait for freshclam to run or run it manually
3. avc error
  
Actual results:
Can't notify clamd

Expected results:
Can notify clamd's sock which is in /var/spool/amavisd

Additional info:
Comment 1 Miroslav Grepl 2012-10-22 08:44:19 EDT
We allow this on F18.

Added to F17.

commit 8bd4fa866f0ba3e21c89c8df9375ca34f43cd22d
Author: Miroslav Grepl <mgrepl@redhat.com>
Date:   Mon Oct 22 14:43:39 2012 +0200

    Allow support for notifyclamd option in /etc/freshclam.conf
Comment 2 Fedora Update System 2012-11-06 03:21:33 EST
selinux-policy-3.10.0-159.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-159.fc17
Comment 3 Fedora Update System 2012-11-07 21:03:38 EST
Package selinux-policy-3.10.0-159.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.10.0-159.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-17782/selinux-policy-3.10.0-159.fc17
then log in and leave karma (feedback).
Comment 4 Fedora Update System 2012-12-20 10:05:13 EST
selinux-policy-3.10.0-159.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.