I am not very informed about SELinux, so I am giving everything I can in this report. I was trying to import an image of CentOS using machinectl as, $ sudo machinectl pull-raw http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.raw.tar.gz But it failed saying "Failed to transfer image: Access denied," with a SELinux alert. The alert reports, that systemd-importd was denied read access to /var/lib/machines. I know that this directory is where machinectl pulls and stores images. If I browse through nautilus and look at the properties of /var/lib/machines, its SELinux Context is system_u:object_r:systemd_machined_var_lib_t:s0. Expected behaviour: Image is pulled, extracted and stored under a new directory of the image name.
Dan, this is the AVC generated when trying to pull: ---- time->Fri Dec 8 15:45:23 2017 type=AVC msg=audit(1512769523.719:9390): avc: denied { read } for pid=21095 comm="systemd-importd" name="machines" dev="dm-0" ino=6161837 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:systemd_machined_var_lib_t:s0 tclass=dir permissive=0
THis is pretty broken. Making init_t is the easiest solution. But it looks like systemd-import is creating a new file system and mounting it I think we will need at least the following: +allow init_t daemon:process2 nnp_transition; +allow init_t systemprocess:process2 nnp_transition; There are some of the other AVC's I get when I run this command in permissive mode. #!!!! This avc can be allowed using the boolean 'nis_enabled' allow init_t http_port_t:tcp_socket name_connect; #!!!! This avc can be allowed using the boolean 'domain_kernel_load_modules' allow init_t kernel_t:system module_request; allow init_t loop_control_device_t:chr_file { ioctl open read write }; allow init_t systemd_machined_var_lib_t:dir { mounton read }; allow init_t unlabeled_t:dir { add_name remove_name setattr write }; allow init_t unlabeled_t:file { create setattr unlink write };
Created attachment 1380155 [details] avcs
Dan, We should write policy for systemd-importd. I'll try to do it in next sprint.
This message is a reminder that Fedora 26 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 26. 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 '26'. 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 26 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 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26 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.
This is a duplicate of bug 1318047, which is unresolved. Please change the status of this bug. (This is the third result on Google for "systemd-importd selinux".)
*** This bug has been marked as a duplicate of bug 1318047 ***