Description of problem: Same problem as in F18. Bugfix already applied but happened again. SELinux is preventing /usr/sbin/nginx from 'write' accesses on the sock_file btcsrv.sn.g02.org.sock. ***** Plugin catchall (100. confidence) suggests *************************** If you believe that nginx should be allowed write access on the btcsrv.sn.g02.org.sock sock_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:var_run_t:s0 Target Objects btcsrv.sn.g02.org.sock [ sock_file ] Source nginx Source Path /usr/sbin/nginx Port <Unknown> Host (removed) Source RPM Packages nginx-1.4.1-1.fc19.x86_64 Target RPM Packages Policy RPM selinux-policy-3.12.1-57.fc19.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name (removed) Platform Linux (removed) 3.9.8-300.fc19.x86_64 #1 SMP Thu Jun 27 19:24:23 UTC 2013 x86_64 x86_64 Alert Count 6 First Seen 2013-07-06 04:40:30 CDT Last Seen 2013-07-06 04:40:33 CDT Local ID ee79fb45-6556-45e5-8009-e4d8b2d63213 Raw Audit Messages type=AVC msg=audit(1373103633.491:1719): avc: denied { write } for pid=26894 comm="nginx" name="btcsrv.sn.g02.org.sock" dev="tmpfs" ino=10957578 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=sock_file type=SYSCALL msg=audit(1373103633.491:1719): arch=x86_64 syscall=connect success=no exit=EACCES a0=c a1=7fbc4e1a8e30 a2=6e a3=7fffc18f1210 items=0 ppid=26893 pid=26894 auid=4294967295 uid=996 gid=996 euid=996 suid=996 fsuid=996 egid=996 sgid=996 fsgid=996 ses=4294967295 tty=(none) comm=nginx exe=/usr/sbin/nginx subj=system_u:system_r:httpd_t:s0 key=(null) Hash: nginx,httpd_t,var_run_t,sock_file,write Additional info: reporter: libreport-2.1.5 hashmarkername: setroubleshoot kernel: 3.9.8-300.fc19.x86_64 type: libreport Potential duplicate: bug 967764
fce11d3fa690af8e040f9de82430d272cdc880f3 has additional fixes for this in git. The problem you have is the /var/run/thin directory is not labeled correctly
selinux-policy-3.12.1-65.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-65.fc19
Package selinux-policy-3.12.1-65.fc19: * should fix your issue, * was pushed to the Fedora 19 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.12.1-65.fc19' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-13172/selinux-policy-3.12.1-65.fc19 then log in and leave karma (feedback).
(In reply to Fedora Update System from comment #3) > Package selinux-policy-3.12.1-65.fc19: > * should fix your issue, > * was pushed to the Fedora 19 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.12.1-65.fc19' > as soon as you are able to. > Please go to the following url: > https://admin.fedoraproject.org/updates/FEDORA-2013-13172/selinux-policy-3. > 12.1-65.fc19 > then log in and leave karma (feedback). Still have the problem: Still have the problem. type=AVC msg=audit(1374152922.172:1360): avc: denied { connectto } for pid=18413 comm="nginx" path="/run/thin/www.evalinux.com.sock" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:initrc_t:s0 tclass=unix_stream_socket type=SYSCALL msg=audit(1374152922.172:1360): arch=c000003e syscall=42 success=no exit=-13 a0=d a1=7fe0768b5a10 a2=6e a3=7fff5f8bb940 items=0 ppid=18412 pid=18413 auid=4294967295 uid=996 gid=996 euid=996 suid=996 fsuid=996 egid=996 sgid=996 fsgid=996 ses=4294967295 tty=(none) comm="nginx" exe="/usr/sbin/nginx" subj=system_u:system_r:httpd_t:s0 key=(null)
selinux-policy-3.12.1-65.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.
What does # ps -efZ |grep initrc
(In reply to Miroslav Grepl from comment #6) > What does > > # ps -efZ |grep initrc # ps -efZ |grep initrc system_u:system_r:initrc_t:s0 redis 503 1 0 Jul31 ? 00:01:08 /usr/sbin/redis-server /etc/redis.conf system_u:system_r:initrc_t:s0 root 12699 1 0 00:33 ? 00:00:02 /usr/bin/ruby-mri /usr/local/bin/thin -C /srv/www/sinatra/btcsrv.com/default/config/thin.yml start unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 root 17961 17922 0 01:30 pts/0 00:00:00 grep --color=auto initrc
We need a policy for /usr/sbin/redis-server.
Also system_u:system_r:initrc_t:s0 root 12699 1 0 00:33 ? 00:00:02 /usr/bin/ruby-mri /usr/local/bin/thin -C /srv/www/sinatra/btcsrv.com/default/config/thin.yml start is it your own thin instance?
(In reply to Miroslav Grepl from comment #9) > Also > > system_u:system_r:initrc_t:s0 root 12699 1 0 00:33 ? > 00:00:02 /usr/bin/ruby-mri /usr/local/bin/thin -C > /srv/www/sinatra/btcsrv.com/default/config/thin.yml start > > is it your own thin instance? Yep, it is. Any thin instance will generate a socket file. Maybe keeping it with a .sock extension would be convenient for SELinux so it could label those as something? Also, redis uses sockets. I think we solved it with: [root@web1 selinux]# cat mynginxsockwrite.te module mynginxsockwrite 1.0; require { type var_run_t; type httpd_t; class sock_file write; } #============= httpd_t ============== allow httpd_t var_run_t:sock_file write; [root@web1 selinux]# cat mythin.te policy_module(mythin, 1.0.0) gen_require(` type thin_t, thin_var_run_t; ') manage_sock_files_pattern(thin_t, thin_var_run_t, thin_var_run_t) apache_read_sys_content(thin_t) gen_require(` type httpd_t; ') stream_connect_pattern(httpd_t, thin_var_run_t, thin_var_run_t, thin_t)
We have these rules. $ rpm -q selinux-policy Basically we would need to get a script which starts this thin instance. See http://mgrepl.wordpress.com/2012/11/30/how-would-tools-like-paster-work-with-selinux-thin-story/ Then we could have a policy with thin_btcsrv_t domain type.
This message is a notice that Fedora 19 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 19. It is Fedora's policy to close all bug reports from releases that are no longer maintained. Approximately 4 (four) weeks from now this bug will be closed as EOL if it remains open with a Fedora 'version' of '19'. 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. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 19 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, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. 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.
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 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. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.