Bug 1009273 - SELinux is preventing /usr/sbin/nginx from 'append' accesses on the file /srv/www/etcspl/logs/error.log.
SELinux is preventing /usr/sbin/nginx from 'append' accesses on the file /srv...
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
i686 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Lukas Vrabec
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-09-18 02:14 EDT by akshay.etcspl
Modified: 2013-10-02 21:18 EDT (History)
4 users (show)

See Also:
Fixed In Version: selinux-policy-3.11.1-105.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-10-02 21:18:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description akshay.etcspl 2013-09-18 02:14:56 EDT
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.
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


#============= 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 09:00:41 EDT
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 12:04:50 EDT
selinux-policy-3.11.1-104.fc18 has been submitted as an update for Fedora 18.
Comment 4 Fedora Update System 2013-09-26 02:09:27 EDT
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:
then log in and leave karma (feedback).
Comment 5 Fedora Update System 2013-09-26 09:23:44 EDT
selinux-policy-3.11.1-105.fc18 has been submitted as an update for Fedora 18.
Comment 6 Fedora Update System 2013-10-02 21:18:26 EDT
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.

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