Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1181338
Summary: | SELinux is preventing openvpn from 'relabelfrom' accesses on the tun_socket Unknown. | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | colin <bugzilla.redhat.com> | ||||
Component: | selinux-policy | Assignee: | Miroslav Grepl <mgrepl> | ||||
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 21 | CC: | bugzilla.redhat.com, dominick.grift, dwalsh, lvrabec, mgrepl, plautrba | ||||
Target Milestone: | --- | Keywords: | Reopened | ||||
Target Release: | --- | ||||||
Hardware: | x86_64 | ||||||
OS: | Unspecified | ||||||
Whiteboard: | abrt_hash:b86fdce991fd5fdcac5eba1fe073d7a8c401cc388c8a94515a4e84ccd7ccf56f | ||||||
Fixed In Version: | selinux-policy-3.13.1-105.3.fc21 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2015-12-02 07:21:18 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: | |||||||
Attachments: |
|
Description
colin
2015-01-12 22:47:08 UTC
Did you disable the SELinux for the daemon? IE is docker running with --selinux-enabled? Hi Dan Sorry for the delay in replying- I am still quite new to SELinux and I had to hunt around abit to find that out. I took a look in /etc/sysconfig/docker and can see that I had commented out the line #OPTIONS=--selinux-enabled some 3 weeks ago. Thanks Colin. If you comment out the line you need to make sure the boolean is turned on. I will add a comment to the /etc/sysconfig/docker to clarify this. Why did you disable SELinux in docker? Hi Dan. You said: > you need to make sure the boolean is turned on Unfortunately I am not sure what was meant by this. > Why did you disable SELinux in docker? I am trying to do useful development work on this VM, and it is securely isolated on a LAN, with only me accessing it. The interactions between 'recent' releases of NetworkManager, teamd, OpenVSwitch, Docker and SELinux is already too unreliable. :-( Progress is hampered by the VM freezing or crashing, and stuff failing to work and having to then reboot. This uses up my time having to then re-establish a bunch of broken connections. I saw on the Redhat website that I could disable MAC in my development container, but alas it appears to have made no difference. At least with SELinux set permissive- I can see what _would_ have been denied, if if it had Actually been enforcing. Of course - I am still at a loss as to how to 'fix' these SELinux issues, but at least I can work on the main project in the meantime. I would certainly appreciate any suggestions for a better way to proceed. Thanks Colin a68f731ed84be330dd4e6cc56314d5d5636deb2c fixes this in git. For now I would just add a custom policy and that should allow this to work. commit cf2f946cabad6aa7d373868431cdaf5f41c476d3 Author: Dan Walsh <dwalsh> Date: Wed Jan 28 09:21:30 2015 -0500 Allow docker to attach to the sandbox and user domains tun devices selinux-policy-3.13.1-105.3.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/selinux-policy-3.13.1-105.3.fc21 Package selinux-policy-3.13.1-105.3.fc21: * should fix your issue, * was pushed to the Fedora 21 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.13.1-105.3.fc21' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-1768/selinux-policy-3.13.1-105.3.fc21 then log in and leave karma (feedback). As above- I did 'yum update --enablerepo=updates-testing selinux-policy-3.13.1-105.3.fc21' to apply the update, and rebooted the VM, but still see the same behaviour. SELinux Alert Browser still showing new alerts, and the suggested solution still seems to fail with the same error. [root@vm117 ~]# grep openvpn /var/log/audit/audit.log | audit2allow -M mypol.tun_socket2 compilation failed: mypol.tun_socket2.te:15:ERROR 'syntax error' at token 'constrain' on line 15: #Constraint rule: constrain tun_socket { create relabelfrom relabelto } ((u1 == u2 -Fail-) or (t1 == can_change_object_identity -Fail-) ); Constraint DENIED /usr/bin/checkmodule: error(s) encountered while parsing configuration /usr/bin/checkmodule: loading policy configuration from mypol.tun_socket2.te [root@vm117 ~]# Maybe I did something wrong? log of yum update attached. ... hmm attachments seem to be disabled. will paste inline. -------------------------------------------------------- [root@vm117 yum]# yum update --enablerepo=updates-testing selinux-policy-3.13.1-105.3.fc21 | tee yum_updates-testing-selinux Loaded plugins: langpacks Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Updating: selinux-policy noarch 3.13.1-105.3.fc21 updates-testing 392 k Updating for dependencies: selinux-policy-targeted noarch 3.13.1-105.3.fc21 updates-testing 3.9 M Transaction Summary ================================================================================ Upgrade 1 Package (+1 Dependent package) Total download size: 4.3 M y Is this ok [y/d/N]: Downloading packages: -------------------------------------------------------------------------------- Total 413 kB/s | 4.3 MB 00:10 Running transaction check Running transaction test Transaction test succeeded Running transaction (shutdown inhibited) Updating : selinux-policy-3.13.1-105.3.fc21.noarch 1/4 Updating : selinux-policy-targeted-3.13.1-105.3.fc21.noarch 2/4 Cleanup : selinux-policy-targeted-3.13.1-105.fc21.noarch 3/4 Cleanup : selinux-policy-3.13.1-105.fc21.noarch 4/4 Verifying : selinux-policy-targeted-3.13.1-105.3.fc21.noarch 1/4 Verifying : selinux-policy-3.13.1-105.3.fc21.noarch 2/4 Verifying : selinux-policy-targeted-3.13.1-105.fc21.noarch 3/4 Verifying : selinux-policy-3.13.1-105.fc21.noarch 4/4 Updated: selinux-policy.noarch 0:3.13.1-105.3.fc21 Dependency Updated: selinux-policy-targeted.noarch 0:3.13.1-105.3.fc21 Complete! selinux-policy-3.13.1-105.3.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report. Description of problem: I have a set of scripts that start openvpn in a docker container. OpenVPN needs to clone the tun device into the container namespace. I attempt to modify seLinux local policy as advised by SELinux Browser, but this seems to fail also. [root@vm117 ~]# grep openvpn /var/log/audit/audit.log | audit2allow -M myOVPNpol compilation failed: myOVPNpol.te:14:ERROR 'syntax error' at token 'constrain' on line 14: constrain tun_socket { create relabelfrom relabelto } ((u1 == u2 -Fail-) or (t1 == can_change_object_identity -Fail-) ); Constraint DENIED #Constraint rule: /usr/bin/checkmodule: error(s) encountered while parsing configuration /usr/bin/checkmodule: loading policy configuration from myOVPNpol.te [root@vm117 ~]# I am forced to run permissive to make this work. Version-Release number of selected component: selinux-policy-3.13.1-105.6.fc21.noarch Additional info: reporter: libreport-2.3.0 hashmarkername: setroubleshoot kernel: 3.18.8-201.fc21.x86_64 type: libreport Please attach the actually avc's you are seeing. Is this tunnel device being shared between two containers? Hi Dan.
> Is this tunnel device being shared between two containers?
No - strictly one OVPN daemon (with its single Layer 2 Tap device) per container.
Inter container networking is via veths.
[root@vm117 audit]# grep -i 'avc: denied' /var/log/audit/audit.log | wc -l
68
I will now upload the output of:
grep -i 'avc: denied' /var/log/audit/audit.log > grep_avc_denied.out
Created attachment 1005890 [details]
grep -i 'avc: denied' /var/log/audit/audit.log > grep_avc_denied.out
show 'avc: denied' messages form /var/log/audit/audit.log
Also - would it be helpful to open a second #BZ ? Since this one is describing 2 related problems, i.e. 1) SELinux appears to be blocking stuff plus 2) The apparent parsing failure when manually running command recommended by the GUI ? Thanks for your help Colin. [update...] AVC errors seem to have stopped after I installed: 'selinux-policy-3.13.1-105.9.fc21 critical path bugfix update' from bodhi: https://admin.fedoraproject.org/updates/selinux-policy-3.13.1-105.9.fc21 see https://bugzilla.redhat.com/show_bug.cgi?id=1186669#c9 selinux-policy-3.13.1-105.11.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/selinux-policy-3.13.1-105.11.fc21 Package selinux-policy-3.13.1-105.11.fc21: * should fix your issue, * was pushed to the Fedora 21 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.13.1-105.11.fc21' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-5478/selinux-policy-3.13.1-105.11.fc21 then log in and leave karma (feedback). This message is a reminder that Fedora 21 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 21. 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 '21'. 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 21 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 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 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. |