Bug 1567768
Summary: | SELinux is preventing nginx from using the 'dac_override' capabilities. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Ed Marshall <esm> |
Component: | nginx | Assignee: | Nobody's working on this, feel free to take it <nobody> |
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 28 | CC: | 7d28c752, affix, anton4linux, athmanem, bperkins, chad.schroeder, dwalsh, esm, evan, jeremy, jkaluza, jonathan, jorti, jorton, luhliari, lvrabec, pahan, pavel.lisy, peter.borsa, plautrba, tadej.j, wtogami |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Unspecified | ||
Whiteboard: | abrt_hash:d30a0e35981359d0104bc2c3c75fda104a76320e1638bcb50d6dc875af6497f7; | ||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2019-05-29 00:01:21 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Ed Marshall
2018-04-16 07:53:56 UTC
Hi, Could you reproduce, but full auditing? ***** Plugin dac_override (91.4 confidence) suggests ********************** If you want to help identify if domain needs this access or you have a file with the wrong permissions on your system Then turn on full auditing to get path information about the offending file and generate the error again. Do Turn on full auditing # auditctl -w /etc/shadow -p w Try to recreate AVC. Then execute # ausearch -m avc -ts recent If you see PATH record check ownership/permissions on file, and fix it, otherwise report as a bugzilla. Same here with selinux-policy-3.14.1-21.fc28.noarch With full auditing: time->Tue Apr 17 18:09:19 2018 type=AVC msg=audit(1523981359.846:520): avc: denied { dac_override } for pid=3418 comm="nginx" capability=1 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:httpd_t:s0 tclass=capability permissive=0 ---- time->Tue Apr 17 18:09:20 2018 type=AVC msg=audit(1523981360.512:521): avc: denied { dac_override } for pid=3418 comm="nginx" capability=1 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:httpd_t:s0 tclass=capability permissive=0 I get this with a brand new unconfigured nginx install out of the box on Fedora 28, with nginx-1.12.1-5.fc28.x86_64 and selinux-policy-3.14.1-21.fc28.noarch Yep, same result as Juan for me. systemctl status says: # systemctl start nginx Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. # systemctl status nginx ● nginx.service - The nginx HTTP and reverse proxy server Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2018-04-27 01:47:53 UTC; 7s ago Process: 16038 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE) Process: 16037 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS) Apr 27 01:47:52 zenbook.sfo1.in.logic.net systemd[1]: Starting The nginx HTTP and reverse proxy server... Apr 27 01:47:52 zenbook.sfo1.in.logic.net nginx[16038]: nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) Apr 27 01:47:52 zenbook.sfo1.in.logic.net nginx[16038]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok Apr 27 01:47:52 zenbook.sfo1.in.logic.net nginx[16038]: 2018/04/27 01:47:52 [emerg] 16038#0: open() "/var/log/nginx/error.log" failed (13: Permission denied) Apr 27 01:47:52 zenbook.sfo1.in.logic.net nginx[16038]: nginx: configuration file /etc/nginx/nginx.conf test failed Apr 27 01:47:53 zenbook.sfo1.in.logic.net systemd[1]: nginx.service: Control process exited, code=exited status=1 Apr 27 01:47:53 zenbook.sfo1.in.logic.net systemd[1]: nginx.service: Failed with result 'exit-code'. Apr 27 01:47:53 zenbook.sfo1.in.logic.net systemd[1]: Failed to start The nginx HTTP and reverse proxy server. Looks like this came up in the context of AppArmor policies too? https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=819751 https://serverfault.com/questions/776940/does-nginx-really-need-dac-override-in-its-apparmor-policy I'm having the same issue. Upgraded from FC27 to FC28 and nginx no longer starts. * nginx-1.12.1-5.fc28.x86_64 * selinux-policy-3.14.1-21.fc28.noarch *** This bug has been marked as a duplicate of bug 1573942 *** I'm unable to see bug 1573942 because it's marked private, so I'm re-opening this bug. Feel free to close again if needed. After installing nginx-1.12.1-7.fc28.x86_64, I'm still seeing this. I get: SELinux is preventing nginx from using the dac_override capability. ***** Plugin dac_override (91.4 confidence) suggests ********************** If you want to help identify if domain needs this access or you have a file with the wrong permissions on your system Then turn on full auditing to get path information about the offending file and generate the error again. Do Turn on full auditing # auditctl -w /etc/shadow -p w Try to recreate AVC. Then execute # ausearch -m avc -ts recent If you see PATH record check ownership/permissions on file, and fix it, otherwise report as a bugzilla. After turning on full auditing, I get the following: ---- time->Sun May 6 07:17:55 2018 type=AVC msg=audit(1525591075.044:178): avc: denied { dac_override } for pid=998 comm="nginx" capability=1 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:httpd_t:s0 tclass=capability permissive=1 ---- time->Sun May 6 07:18:14 2018 type=AVC msg=audit(1525591094.369:194): avc: denied { dac_override } for pid=1036 comm="nginx" capability=1 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:httpd_t:s0 tclass=capability permissive=1 Hey Jonathan, I made bug 1573942 public. I tried to reproduce the SELinux dac_override issue, but I was not successful. With new version of nginx, I'm able to start nginx server without any problems: # rpm -qa nginx nginx-1.12.1-7.fc28.x86_64 # systemctl start nginx Ok, I've figured it out. I did an upgrade from Fedora 27 to Fedora 28, and apparently the owner of the files in /var/log/nginx has changed from nginx to root. After changing the owner and group of /var/log/nginx/access.log and /var/log/nginx/error.log to root, the problem disappeared. This should probably be documented somewhere, but I'll go ahead and change my karma since it seems to be an upgrade issue. Description of problem: I just trie to start nginx after my Fedora 28 upgrade. Version-Release number of selected component: selinux-policy-3.14.1-24.fc28.noarch Additional info: reporter: libreport-2.9.5 hashmarkername: setroubleshoot kernel: 4.16.6-302.fc28.x86_64 type: libreport (In reply to Jonathan Dieter from comment #9) > Ok, I've figured it out. I did an upgrade from Fedora 27 to Fedora 28, and > apparently the owner of the files in /var/log/nginx has changed from nginx > to root. After changing the owner and group of /var/log/nginx/access.log > and /var/log/nginx/error.log to root, the problem disappeared. Thanks for this tip Jonathan -- changing the owner of the files to root does indeed fix the problem for me. I'm not sure if this is the "right" solution or not, but at least it lets me re-enable SELinux. As an FYI, it looks like the logrotate configuration also needs to be updated to the new permissions/ownership, or the problem will show up again after nginx restarts following a log rotation. Hi Ed, you are right logrotate configuration needs to be update. I will create new build today with patch, which should fix problems with owner/group permissions after USR1 signal is sent. This message is a reminder that Fedora 28 is nearing its end of life. On 2019-May-28 Fedora will stop maintaining and issuing updates for Fedora 28. 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 EOL if it remains open with a Fedora 'version' of '28'. 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 28 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 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 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. |