Bug 888740 - RFE: add policy for nginx webserver
Summary: RFE: add policy for nginx webserver
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 836502
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-19 11:37 UTC by Jan Vcelak
Modified: 2014-03-05 14:56 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 836502
Environment:
Last Closed: 2014-02-05 14:01:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jan Vcelak 2012-12-19 11:37:53 UTC
Now we have a policy for php-fpm. Please, can we also have some for nginx webserver?

+++ This bug was initially created as a clone of Bug #836502 +++

Description of problem:

When PHP sites are served by alternative web server (nginx, lighttpd, cherokee, etc.) with php-fpm (PHP FastCGI Process Manager), SELinux does not provide as much security as with Apache webserver.

Nginx is becoming very popular recently [1], it is a pity we do not have a policy for it. And the only way to restrict the PHP is to run it trough mod_php in Apache as a backend for nginx proxy. (Which sucks.)

[1] http://news.netcraft.com/archives/2012/06/06/june-2012-web-server-survey.html


Version-Release number of selected component (if applicable):
any

How reproducible:


Steps to Reproduce:
1. install nginx and php-fpm, change php-fpm user from apache to nginx
2. systemctl start php-fpm.service nginx.service
3. ps axZ | grep -E '(nginx|php)'
  
Actual results:

system_u:system_r:initrc_t:s0    5334 ?        Ss     0:00 php-fpm: master process (/etc/php-fpm.conf)
system_u:system_r:initrc_t:s0    5335 ?        S      0:00 php-fpm: pool www
system_u:system_r:initrc_t:s0    5336 ?        S      0:00 php-fpm: pool www
system_u:system_r:initrc_t:s0    5337 ?        S      0:00 php-fpm: pool www
system_u:system_r:initrc_t:s0    5338 ?        S      0:00 php-fpm: pool www
system_u:system_r:initrc_t:s0    5339 ?        S      0:00 php-fpm: pool www
system_u:system_r:initrc_t:s0    5513 ?        Ss     0:00 nginx: master process /usr/sbin/nginx
system_u:system_r:initrc_t:s0    5514 ?        S      0:00 nginx: worker process


Expected results:
ningx and php-fpm running is some more confined domain


Additional info:

...

--- Additional comment from Miroslav Grepl on 2012-12-16 11:22:00 CET ---

commit fd3d7d3bf47fa42fb2731b3446ace6b82b3017ec
Author: Miroslav Grepl <mgrepl>
Date:   Sun Dec 16 11:20:11 2012 +0100

    Add support for php-fpm

--- Additional comment from Dominick Grift on 2012-12-17 18:31:16 CET ---

We should probably make nginx run in httpd domain as well. If i am correct ngix is currently not targeted

--- Additional comment from Fedora Update System on 2012-12-17 19:40:44 CET ---

selinux-policy-3.10.0-165.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-165.fc17

Comment 1 Miroslav Grepl 2012-12-19 13:40:34 UTC
Dominick,
AFAIK you were talking also about nginx, right?

Comment 2 Dominick Grift 2012-12-19 15:47:03 UTC
Right, i would just run nginx in the httpd_t domain

http://oss.tresys.com/pipermail/refpolicy/2011-March/004135.html

Comment 4 Konstantin Ryabitsev 2013-11-05 15:59:11 UTC
Would love to see this added to RHEL's policy. Was a bit shocked to find out that nginx runs in initrc_t, seeing how widely it is used as a webserver and accelerator. :)

Comment 5 Fedora End Of Life 2013-12-21 09:59:03 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. 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 '18'.

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 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 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 to Fedora 18's end of life.

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.

Comment 6 Fedora End Of Life 2014-02-05 14:01:49 UTC
Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 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.

Comment 7 Peter Meier 2014-02-05 15:58:24 UTC
There is imho still now policy on for nginx. So plz reopen.

Comment 8 Miroslav Grepl 2014-03-05 14:56:23 UTC
apache.fc:/etc/nginx(/.*)?         gen_context(system_u:object_r:httpd_config_t,s0)
apache.fc:/usr/lib/systemd/system/nginx.*     --  gen_context(system_u:object_r:httpd_unit_file_t,s0)
apache.fc:/usr/sbin/nginx         --  gen_context(system_u:object_r:httpd_exec_t,s0)
apache.fc:/var/lib/nginx(/.*)?            gen_context(system_u:object_r:httpd_var_lib_t,s0)
apache.fc:/var/log/nginx(/.*)?     gen_context(system_u:object_r:httpd_log_t,s0)
apache.fc:/var/run/nginx.*            gen_context(system_u:object_r:httpd_var_run_t,s0)


is a part of newest releases.


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