Bug 494037

Summary: SELinux is preventing 0logwatch (logwatch_t) "getattr" to /var/spool/bacula/log (var_spool_t).
Product: [Fedora] Fedora Reporter: Debbie D <redhatbugzilla>
Component: baculaAssignee: Andreas Thienemann <andreas>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: andreas, fschwarz, gwync, mmcgrath, paul, pk, renich, rvc.pobox, stefmanos
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-05 06:57:28 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 Debbie D 2009-04-03 19:57:33 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.8) Gecko/2009032713 Fedora/3.0.8-1.fc10 Firefox/3.0.8

The details below are from the SELinux error report.  Doing the restorecon does not solve the problem.  There is nothing in /var/spool/bacula/log.

--------------------------------------------------------------------

SELinux denied access requested by 0logwatch. It is not expected that this
access is required by 0logwatch and this access may signal an intrusion attempt.
It is also possible that the specific version or configuration of the
application is causing it to require additional access.

Allowing Access:

Sometimes labeling problems can cause SELinux denials. You could try to restore
the default system file context for /var/spool/bacula/log,

restorecon -v '/var/spool/bacula/log'

If this does not work, there is currently no automatic way to allow this access.
Instead, you can generate a local policy module to allow this access - see FAQ
(http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Or you can disable
SELinux protection altogether. Disabling SELinux protection is not recommended.
Please file a bug report (http://bugzilla.redhat.com/bugzilla/enter_bug.cgi)
against this package.

Additional Information:

Source Context                system_u:system_r:logwatch_t:s0-s0:c0.c1023
Target Context                system_u:object_r:var_spool_t:s0
Target Objects                /var/spool/bacula/log [ file ]
Source                        0logwatch
Source Path                   /usr/bin/perl
Port                          <Unknown>
Host                          athena.ddeutsch.net
Source RPM Packages           perl-5.10.0-56.fc10
Target RPM Packages           
Policy RPM                    selinux-policy-3.5.13-53.fc10
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   catchall_file
Host Name                     athena.ddeutsch.net
Platform                      Linux athena.ddeutsch.net
                              2.6.27.19-170.2.35.fc10.x86_64 #1 SMP Mon Feb 23
                              13:00:23 EST 2009 x86_64 x86_64
Alert Count                   23
First Seen                    Mon 23 Mar 2009 04:49:38 AM EDT
Last Seen                     Fri 03 Apr 2009 04:49:19 AM EDT
Local ID                      f6aa2ecf-44d7-4cef-b526-068334ac7ff4
Line Numbers                  

Raw Audit Messages            

node=athena.ddeutsch.net type=AVC msg=audit(1238748559.733:493): avc:  denied  { getattr } for  pid=19240 comm="0logwatch" path="/var/spool/bacula/log" dev=dm-4 ino=1392697 scontext=system_u:system_r:logwatch_t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_spool_t:s0 tclass=file

node=athena.ddeutsch.net type=SYSCALL msg=audit(1238748559.733:493): arch=c000003e syscall=4 success=no exit=-13 a0=24b4bb8 a1=2418130 a2=2418130 a3=0 items=0 ppid=19182 pid=19240 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=64 comm="0logwatch" exe="/usr/bin/perl" subj=system_u:system_r:logwatch_t:s0-s0:c0.c1023 key=(null)




Reproducible: Always

Steps to Reproduce:
1. Get bacula up and running (bacula-dir, bacula-fd, bacula-sd)
2. Wait for daily SELinux error!  (I have changed very little in the bacula .conf files, basically only names and passwords.  The same generally is true for my Fedora 10 installation.  It is only a few weeks old and while I have added some packages not in the baseline distribution I have made very few changes to any configuration, and specifically no changes to anything having to do with logging.)
3.
Actual Results:  
See the error report reproduced above.  I would be happy to supply any additional information you need from me.

Expected Results:  
I think there were supposed to be entries made in a log file (without SELinux errors).  There is nothing at all in /var/log/bacula/log.

My Fedora 10 installation is completely up to date for SELinux and bacula files.

Comment 1 Paul Howarth 2009-04-04 12:07:39 UTC
The cleanest solution for this would be to have bacula write its log files to /var/log/bacula rather than /var/spool/bacula/log, and fix the logwatch/logrorate scriptlets for bacula accordingly.

logwatch and logrotate won't have issues with SELinux under /var/log.

Comment 2 Stephanos Manos 2009-06-23 07:45:11 UTC
Still present in F11.

Also there is another solution until (and if) the file is moved to /var/log. Label the file as var_log_t with
semanage fcontext -a -t var_log_t "/var/spool/bacula/log"

Comment 3 Bug Zapper 2009-11-18 11:40:49 UTC
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 4 Paul Howarth 2009-11-18 12:51:42 UTC
The bacula-dir.conf file from current bacula-director-common on F-11 has two logging directives, one pointing to /var/log/bacula.log and one to /var/spool/bacula/log.

I thing the first of these should be changed to /var/log/bacula/standard.log and the second to /var/log/bacula/daemon.log so that the existing /var/log/bacula directory actually gets used for something and the SELinux issue with /var/spool goes away. It certainly seems pointless to have a /var/log/bacula directory and then go and write logs to /var/log/bacula.log.

Comment 5 Paul Howarth 2009-12-18 20:29:07 UTC
*** Bug 546965 has been marked as a duplicate of this bug. ***

Comment 6 Daniel Walsh 2009-12-29 23:49:36 UTC
*** Bug 550877 has been marked as a duplicate of this bug. ***

Comment 7 Daniel Walsh 2010-02-16 15:53:25 UTC
*** Bug 565778 has been marked as a duplicate of this bug. ***

Comment 8 Bug Zapper 2010-04-27 13:29:27 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Bug Zapper 2010-11-04 11:22:56 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 10 Bug Zapper 2010-12-05 06:57:28 UTC
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.