Bug 709246

Summary: SELinux is preventing /usr/sbin/httpd from 'open' accesses on the file /var/log/roundcubemail/sendmail.
Product: [Fedora] Fedora Reporter: Michal Hlavinka <mhlavink>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 15CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:93000204a0dbea0b350e5e31e54052054bdd342fe42b79e8f371f93d9eb4c858
Fixed In Version: selinux-policy-3.9.16-32.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-08 18:10:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Michal Hlavinka 2011-05-31 07:31:04 UTC
SELinux is preventing /usr/sbin/httpd from 'open' accesses on the file /var/log/roundcubemail/sendmail.

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

If you believe that httpd should be allowed open access on the sendmail 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 httpd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                system_u:object_r:var_log_t:s0
Target Objects                /var/log/roundcubemail/sendmail [ file ]
Source                        httpd
Source Path                   /usr/sbin/httpd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           httpd-2.2.17-10.fc15.1
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-24.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 2.6.38.6-27.fc15.x86_64
                              #1 SMP Sun May 15 17:23:28 UTC 2011 x86_64 x86_64
Alert Count                   1
First Seen                    Tue 31 May 2011 09:30:08 AM CEST
Last Seen                     Tue 31 May 2011 09:30:08 AM CEST
Local ID                      39ef9a3c-1af3-4ccc-9720-ca56182f9feb

Raw Audit Messages
type=AVC msg=audit(1306827008.423:14928): avc:  denied  { open } for  pid=5245 comm="httpd" name="sendmail" dev=sdb1 ino=133571 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file


type=SYSCALL msg=audit(1306827008.423:14928): arch=x86_64 syscall=open success=yes exit=ENOTBLK a0=7f99e67516a0 a1=441 a2=1b6 a3=676f6c2f7261762f items=0 ppid=1447 pid=5245 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm=httpd exe=/usr/sbin/httpd subj=system_u:system_r:httpd_t:s0 key=(null)

Hash: httpd,httpd_t,var_log_t,file,open

audit2allow

#============= httpd_t ==============
allow httpd_t var_log_t:file open;

audit2allow -R

#============= httpd_t ==============
allow httpd_t var_log_t:file open;

Comment 1 Dominick Grift 2011-05-31 07:52:15 UTC
could you try: chcon -R -t httpd_log_t /var/log/roundcubemail/ and see where that gets you?

Comment 2 Michal Hlavinka 2011-05-31 10:42:19 UTC
with this context, there is no selinux denial

Comment 3 Dominick Grift 2011-05-31 10:50:15 UTC
I gather the webapp able to actually log there as well. Did you try that out?

Comment 4 Dominick Grift 2011-05-31 10:58:43 UTC
Label /var/log/roundcubemail type httpd_log_t:

http://git.fedorahosted.org/git/?p=selinux-policy.git;a=commitdiff;h=1032b49d90f7e07d18e12a0c189f4c12cb262f07

Comment 5 Michal Hlavinka 2011-05-31 10:59:09 UTC
I do not completely understand you comment. Anyway, I have selinux in permissive mode, so it does not prevent logging. After changing context, messages are still being logged and there is no denial, so it works

Comment 6 Miroslav Grepl 2011-05-31 11:37:44 UTC
Michal,
keep the label and see if you get a new issue related to this label.


And btw. switch to enforcing mode.

Comment 7 Miroslav Grepl 2011-06-29 13:17:59 UTC
Fixed in selinux-policy-3.9.16-31.fc15

Comment 8 Fedora Update System 2011-06-30 15:58:45 UTC
selinux-policy-3.9.16-31.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-31.fc15

Comment 9 Fedora Update System 2011-07-01 18:55:14 UTC
Package selinux-policy-3.9.16-32.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-32.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-32.fc15
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2011-07-08 18:09:30 UTC
selinux-policy-3.9.16-32.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.