Bug 1009273

Summary: SELinux is preventing /usr/sbin/nginx from 'append' accesses on the file /srv/www/etcspl/logs/error.log.
Product: [Fedora] Fedora Reporter: akshay.etcspl
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, lvrabec, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:6ff4820fa6f094929a7d30454adce900ed2dc3f9dd6dfb4eb333adf605c59e75
Fixed In Version: selinux-policy-3.11.1-105.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-03 01:18:26 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 akshay.etcspl 2013-09-18 06:14:56 UTC
Description of problem:
SELinux is preventing /usr/sbin/nginx from 'append' accesses on the file /srv/www/etcspl/logs/error.log.

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

If you believe that nginx should be allowed append access on the error.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 nginx /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:httpd_keytab_t:s0
Target Objects                /srv/www/etcspl/logs/error.log [ file ]
Source                        nginx
Source Path                   /usr/sbin/nginx
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           nginx-1.2.9-1.fc18.i686
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-100.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.10.11-100.fc18.i686 #1 SMP Mon
                              Sep 9 13:50:39 UTC 2013 i686 i686
Alert Count                   3
First Seen                    2013-09-17 18:57:22 IST
Last Seen                     2013-09-18 10:52:17 IST
Local ID                      e19df547-152e-4bd9-8492-cfcc24770f9e

Raw Audit Messages
type=AVC msg=audit(1379481737.543:359): avc:  denied  { append } for  pid=20204 comm="nginx" name="error.log" dev="dm-1" ino=786442 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_keytab_t:s0 tclass=file


type=SYSCALL msg=audit(1379481737.543:359): arch=i386 syscall=open success=no exit=EACCES a0=b8fd14bf a1=8441 a2=1a4 a3=3 items=0 ppid=1 pid=20204 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=nginx exe=/usr/sbin/nginx subj=system_u:system_r:httpd_t:s0 key=(null)

Hash: nginx,httpd_t,httpd_keytab_t,file,append

audit2allow

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

allow httpd_t httpd_keytab_t:file append;

audit2allow -R
require {
	type httpd_t;
	type httpd_keytab_t;
	class file append;
}

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

allow httpd_t httpd_keytab_t:file append;


Additional info:
reporter:       libreport-2.1.6
hashmarkername: setroubleshoot
kernel:         3.10.11-100.fc18.i686
type:           libreport

Comment 1 Lukas Vrabec 2013-09-18 13:00:41 UTC
Hi,
For now use : chcon -R -t httpd_log_t  /srv/www/etcspl/logs/

we add support for this in apache policy.

Comment 3 Fedora Update System 2013-09-24 16:04:50 UTC
selinux-policy-3.11.1-104.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-104.fc18

Comment 4 Fedora Update System 2013-09-26 06:09:27 UTC
Package selinux-policy-3.11.1-104.fc18:
* should fix your issue,
* was pushed to the Fedora 18 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.11.1-104.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-17624/selinux-policy-3.11.1-104.fc18
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2013-09-26 13:23:44 UTC
selinux-policy-3.11.1-105.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-105.fc18

Comment 6 Fedora Update System 2013-10-03 01:18:26 UTC
selinux-policy-3.11.1-105.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.