Bug 1281765
Summary: | cobbler sync access to /etc/{dnsmasq.conf,ether} | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Francesco Frassinelli (frafra) <fraph24> |
Component: | selinux-policy | Assignee: | Lukas Vrabec <lvrabec> |
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 23 | CC: | dominick.grift, dwalsh, fraph24, jimi, lvrabec, mgrepl, orion, pablo.iranzo, plautrba, scott, vanmeeuwen+fedora |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-12-20 15:48:50 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Francesco Frassinelli (frafra)
2015-11-13 12:04:54 UTC
Could you please attach raw AVC msgs? Thank you. I'm unable to reproduce. I tried to use restorecon on those files, but it still works. I'll test it on a virtual rawhide. With "setsebool -P httpd_can_network_connect false" (default) I get this error: httpd does not appear to be running and proxying cobbler, or SELinux is in the way. Original traceback: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/cobbler/cli.py", line 252, in check_setup s.ping() File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__ return self.__send(self.__name, args) File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request verbose=self.__verbose File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request return self.single_request(host, handler, request_body, verbose) File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request response.msg, ProtocolError: <ProtocolError for 127.0.0.1:80/cobbler_api: 503 Service Unavailable> I think that in order to reproduce I should add a distribution, but it's difficult to understand how: I used a fresh Fedora rawhide installation, and here's what happened: # dnf install cobbler-web # why it requires yum on f24? and why cobbler doesn't require cobbler-web even if cobbler sync needs it? [...] # sed -i "s;^\(module = manage_\)\(bind\|isc\)$;\1dnsmasq;" /etc/cobbler/modules.conf # replace manage_bind and manage_isc with manage_dnsmasq # systemctl start httpd cobblerd # cobbler sync httpd does not appear to be running and proxying cobbler, or SELinux is in the way. Original traceback: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/cobbler/cli.py", line 252, in check_setup s.ping() File "/usr/lib64/python2.7/xmlrpclib.py", line 1240, in __call__ return self.__send(self.__name, args) File "/usr/lib64/python2.7/xmlrpclib.py", line 1599, in __request verbose=self.__verbose File "/usr/lib64/python2.7/xmlrpclib.py", line 1280, in request return self.single_request(host, handler, request_body, verbose) File "/usr/lib64/python2.7/xmlrpclib.py", line 1328, in single_request response.msg, ProtocolError: <ProtocolError for 127.0.0.1:80/cobbler_api: 503 Service Unavailable> # setsebool -P httpd_can_network_connect true # https://fedorahosted.org/cobbler/wiki/UsingCobblerImport#SElinuxspecificsettingsforF14tokeepinmind # cobbler sync task started: 2015-12-28_160429_sync task started (id=Sync, time=Mon Dec 28 16:04:29 2015) running pre-sync triggers cleaning trees removing: /var/lib/tftpboot/grub/images copying bootloaders Exception occured: <class 'cexceptions.CX'> Exception value: 'Could not find files matching /usr/lib/syslinux/pxelinux.0' Exception Info: File "/usr/lib/python2.7/site-packages/cobbler/remote.py", line 87, in run rc = self._run(self) File "/usr/lib/python2.7/site-packages/cobbler/remote.py", line 186, in runner return self.remote.api.sync(self.options.get("verbose",False),logger=self.logger) File "/usr/lib/python2.7/site-packages/cobbler/api.py", line 779, in sync return sync.run() File "/usr/lib/python2.7/site-packages/cobbler/action_sync.py", line 114, in run self.tftpd.sync(self.verbose) File "/usr/lib/python2.7/site-packages/cobbler/modules/manage_in_tftpd.py", line 170, in sync self.pxegen.copy_bootloaders() File "/usr/lib/python2.7/site-packages/cobbler/pxegen.py", line 98, in copy_bootloaders dst, api=self.api, cache=False, logger=self.logger) File "/usr/lib/python2.7/site-packages/cobbler/utils.py", line 1258, in copyfile_pattern raise CX(_("Could not find files matching %s") % pattern) !!! TASK FAILED !!! # dnf install syslnux-tftpboot # cobbler sync [...] *** TASK COMPLETE *** # curl -LO https://download.fedoraproject.org/pub/fedora/linux/releases/23/Server/x86_64/iso/Fedora-Server-netinst-x86_64-23.iso [...] # # https://fedorahosted.org/cobbler/wiki/UsingCobblerImport#SettingUpAProvisioningServerFromScratch # mkdir Fedora-Server-netinst-x86_64-23 # mount -o loop,ro Fedora-Server-netinst-x86_64-23.iso Fedora-Server-netinst-x86_64-23 # cobbler import --path=/home/frafra/Fedora-Server-netinst-x86_64-23 --name=Fedora-Server-netinst-x86_64-23 task started: 2015-12-28_163139_import task started (id=Media import, time=Mon Dec 28 16:31:39 2015) Exception occured: <class 'cobbler.cexceptions.CX'> Exception value: 'Command failed' Exception Info: File "/usr/lib/python2.7/site-packages/cobbler/remote.py", line 87, in run rc = self._run(self) File "/usr/lib/python2.7/site-packages/cobbler/remote.py", line 231, in runner self.logger File "/usr/lib/python2.7/site-packages/cobbler/api.py", line 892, in import_tree utils.run_this(rsync_cmd, (spacer, mirror_url, path), self.logger) File "/usr/lib/python2.7/site-packages/cobbler/utils.py", line 917, in run_this die(logger,"Command failed") File "/usr/lib/python2.7/site-packages/cobbler/utils.py", line 134, in die raise CX(msg) !!! TASK FAILED !!! # umount Fedora-Server-netinst-x86_64-23 # rmdir Fedora-Server-netinst-x86_64-23 # # Trying an even older doc https://fedorahosted.org/cobbler/wiki/HowToPxeAnyLiveCd # dnf install livecd-tools [...] # livecd-iso-to-pxeboot Fedora-Server-netinst-x86_64-23.iso # mkdir -p /srv/livecd/ # cp tftpboot/vmlinuz /srv/livecd/ # cp tftpboot/initrd.img /srv/livecd/ # cobbler distro add --name=F23Server --kernel=/srv/livecd/vmlinuz --initrd=/srv/livecd/initrd.img exception on server: 'kernel not found: /srv/livecd/vmlinuz' # # https://cobbler.github.io/manuals/quickstart/ gives the same result Got it today: Audit.log type=AVC msg=audit(1456315950.811:221269): avc: denied { read } for pid=7410 comm="cobblerd" name="cobbler" dev="dm-1" ino=1181319 scontext=system_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:cobbler_var_log_t:s0 tclass=dir permissive=0 type=AVC msg=audit(1456315959.932:221270): avc: denied { read } for pid=7460 comm="cobblerd" name="cobbler" dev="dm-1" ino=1181319 scontext=system_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:cobbler_var_log_t:s0 tclass=dir permissive=0 type=AVC msg=audit(1456319000.947:221841): avc: denied { read } for pid=15021 comm="cobblerd" name="dnsmasq.conf" dev="dm-1" ino=783363 scontext=system_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:dnsmasq_etc_t:s0 tclass=file permissive=0 type=AVC msg=audit(1456319070.832:221848): avc: denied { read } for pid=15256 comm="cobblerd" name="dnsmasq.conf" dev="dm-1" ino=783363 scontext=system_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:dnsmasq_etc_t:s0 tclass=file permissive=0 type=AVC msg=audit(1456319128.430:221849): avc: denied { create } for pid=15535 comm="cobblerd" name="dnsmasq.conf" scontext=system_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:etc_t:s0 tclass=file permissive=0 messages.log Feb 24 14:05:42 nas dbus[943]: [system] Activating service name='org.fedoraproject.Setroubleshootd' (using servicehelper) Feb 24 14:05:43 nas dbus[943]: [system] Successfully activated service 'org.fedoraproject.Setroubleshootd' Feb 24 14:05:44 nas setroubleshoot: SELinux is preventing /usr/bin/python2.7 from create access on the file dnsmasq.conf. For complete SELinux messages. run sealert -l 2dc1c281-bf13-44c9-980f-7cd33899723d Feb 24 14:05:44 nas python3: SELinux is preventing /usr/bin/python2.7 from create access on the file dnsmasq.conf.#012#012***** Plugin catchall_labels (83.8 confidence) suggests *******************#012#012If you want to allow python2.7 to have create access on the dnsmasq.conf file#012Then you need to change the label on dnsmasq.conf#012Do#012# semanage fcontext -a -t FILE_TYPE 'dnsmasq.conf'#012where FILE_TYPE is one of the following: cobbler_tmp_t, cobbler_var_lib_t, cobbler_var_log_t, named_zone_t, rsync_etc_t, systemd_passwd_var_run_t, tftpd_etc_t. #012Then execute: #012restorecon -v 'dnsmasq.conf'#012#012#012***** Plugin catchall (17.1 confidence) suggests **************************#012#012If you believe that python2.7 should be allowed create access on the dnsmasq.conf file by default.#012Then you should report this as a bug.#012You can generate a local policy module to allow this access.#012Do#012allow this access for now by executing:#012# grep cobblerd /var/log/audit/audit.log | audit2allow -M mypol#012# semodule -i mypol.pp#012 sealert: sealert -l aa7ed4cc-13b2-4d4c-aec6-6174acfcb28f SELinux is preventing /usr/bin/python2.7 from read access on the file /etc/dnsmasq.conf. ***** Plugin catchall (100. confidence) suggests ************************** If you believe that python2.7 should be allowed read access on the dnsmasq.conf 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 cobblerd /var/log/audit/audit.log | audit2allow -M mypol # semodule -i mypol.pp Additional Information: Source Context system_u:system_r:cobblerd_t:s0 Target Context system_u:object_r:dnsmasq_etc_t:s0 Target Objects /etc/dnsmasq.conf [ file ] Source cobblerd Source Path /usr/bin/python2.7 Port <Unknown> Host nas.example.com Source RPM Packages python-2.7.10-8.fc23.x86_64 Target RPM Packages dnsmasq-2.75-3.fc23.x86_64 Policy RPM selinux-policy-3.13.1-158.6.fc23.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name nas.example.com Platform Linux nas.example.com 4.3.4-300.fc23.x86_64 #1 SMP Mon Jan 25 13:39:23 UTC 2016 x86_64 x86_64 Alert Count 14 First Seen 2015-06-03 20:35:03 CEST Last Seen 2016-02-24 14:04:30 CET Local ID aa7ed4cc-13b2-4d4c-aec6-6174acfcb28f Raw Audit Messages type=AVC msg=audit(1456319070.832:221848): avc: denied { read } for pid=15256 comm="cobblerd" name="dnsmasq.conf" dev="dm-1" ino=783363 scontext=system_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:dnsmasq_etc_t:s0 tclass=file permissive=0 type=SYSCALL msg=audit(1456319070.832:221848): arch=x86_64 syscall=open success=no exit=EACCES a0=7f0e280be560 a1=242 a2=1b6 a3=240 items=0 ppid=1 pid=15256 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=cobblerd exe=/usr/bin/python2.7 subj=system_u:system_r:cobblerd_t:s0 key=(null) Hash: cobblerd,cobblerd_t,dnsmasq_etc_t,file,read This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This message is a reminder that Fedora 23 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 23. 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 '23'. 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 23 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 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 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. |