Bug 705416

Summary: SELinux is preventing /usr/bin/freshclam from 'open' accesses on the file /var/log/freshclam.log.
Product: [Fedora] Fedora Reporter: M. A. MacLain <mgml>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:39c18ff51fda817041f17f2b29feecdfe20fea439bade9cae45173608549b0a8
Fixed In Version: selinux-policy-3.9.16-26.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-03 05:29:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description M. A. MacLain 2011-05-17 15:49:45 UTC
SELinux is preventing /usr/bin/freshclam from 'open' accesses on the file /var/log/freshclam.log.

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

If you believe that freshclam should be allowed open access on the freshclam.log file 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                unconfined_u:object_r:var_log_t:s0
Target Objects                /var/log/freshclam.log [ file ]
Source                        freshclam
Source Path                   /usr/bin/freshclam
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           clamav-update-0.97-1501.fc15
Target RPM Packages           clamav-update-0.97-1501.fc15
Policy RPM                    selinux-policy-3.9.16-23.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.6-26.rc1.fc15.x86_64 #1 SMP Mon
                              May 9 20:45:15 UTC 2011 x86_64 x86_64
Alert Count                   3
First Seen                    Mon 16 May 2011 02:02:09 PM EDT
Last Seen                     Tue 17 May 2011 11:02:09 AM EDT
Local ID                      5be33ed6-6503-43fc-adad-2c1ce6b4decd

Raw Audit Messages
type=AVC msg=audit(1305644529.787:180): avc:  denied  { open } for  pid=7017 comm="freshclam" name="freshclam.log" dev=sda8 ino=135542 scontext=system_u:system_r:freshclam_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:var_log_t:s0 tclass=file


type=SYSCALL msg=audit(1305644529.787:180): arch=x86_64 syscall=open success=yes exit=ESRCH a0=1b46f80 a1=441 a2=1b6 a3=2d2d2d2d2d2d2d2d items=0 ppid=2386 pid=7017 auid=0 uid=493 gid=488 euid=493 suid=493 fsuid=493 egid=488 sgid=488 fsgid=488 tty=(none) ses=3 comm=freshclam exe=/usr/bin/freshclam subj=system_u:system_r:freshclam_t:s0-s0:c0.c1023 key=(null)

Hash: freshclam,freshclam_t,var_log_t,file,open

audit2allow

#============= freshclam_t ==============
#!!!! This avc is allowed in the current policy

allow freshclam_t var_log_t:file open;

audit2allow -R

#============= freshclam_t ==============
#!!!! This avc is allowed in the current policy

allow freshclam_t var_log_t:file open;

Comment 1 Miroslav Grepl 2011-05-18 05:36:35 UTC
# rpm -ql clamav-update |grep log
/etc/logrotate.d/clamav-update
/var/log/freshclam.log


Could you please execute

# chcon -t freshclam_var_log_t /var/log/freshclam.log

Will fix for now.

Comment 2 M. A. MacLain 2011-05-18 17:56:46 UTC
I did.  Thanks

Comment 3 Miroslav Grepl 2011-05-24 07:01:33 UTC
Fixed in selinux-policy-3.9.16-25.fc15

Comment 4 Fedora Update System 2011-05-27 16:55:50 UTC
selinux-policy-3.9.16-26.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-26.fc15

Comment 5 Fedora Update System 2011-05-28 23:57:53 UTC
Package selinux-policy-3.9.16-26.fc15:
* should fix your issue,
* was pushed to the Fedora 15 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.9.16-26.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-26.fc15
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2011-06-03 05:29:05 UTC
selinux-policy-3.9.16-26.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.