| Summary: | Cannot control selinux context for xrdp connections | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | RW Shore <rws228> |
| Component: | selinux-policy | Assignee: | Lukas Vrabec <lvrabec> |
| Status: | CLOSED DUPLICATE | QA Contact: | BaseOS QE Security Team <qe-baseos-security> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.0 | CC: | bojan, dwalsh, itamar, joshua.brindle, lvrabec, mgrepl, mmalik, plautrba, ssekidde |
| Target Milestone: | rc | Keywords: | Reopened |
| Target Release: | 7.5 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-06-12 13:21:55 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: | |
|
Description
RW Shore
2016-09-15 11:14:37 UTC
please report this against selinux package, thank you. We could try to run the xrdb process as xdm_t or local_login_t or sshd_t, which could get the transition to happen correctly. You could do a quick experiment on this. chcon -t xdm_exec_t PATHTO/xrdb Then restart the service using systemd. Now see of the xrdb service is running as xdm_exec_t. You might need to do this in permissive mode. Now connect to the xrdb service and see what the context of the user ends up with. If the user ends up running as unconfined_t or user_t, you are most of the way there. If there are AVC's we can look at them and see if we can easily add them to the login domains.
If this works we can also label xrdb correctly in selinux-policy.
Now this is all my assumption that xrdb is really a fancy remote login program.
*** This bug has been marked as a duplicate of bug 1421573 *** I ran into this on F30, unfortunately RHEL8 doesn't have xrdp RPMs currently. The duplicate mark above is incorrect, bug 1421573 has nothing to do with this. Daniel's suggestion above is almost correct, you can label xrdp-sesman as xdm_exec_t and it will run as xdm_t, but the xrdp pam config does not have the selinux parts, this needs to be added to pam.d/xrdp-sesman: # pam_selinux.so close should be the first session rule session required pam_selinux.so close session required pam_loginuid.so # pam_selinux.so open should only be followed by sessions to be executed in the user context session required pam_selinux.so open env_params *above* the session line that is already there. Additionally, xdm_t would need some additional permissions. xrdp-sesman tries to write to etc_t and runs startwm.sh from the users home directory. So either those rules will have to be added to xdm's policy or a new policy for xrdp-sesman will have to be written, if that is written the selinux contexts/users files will need to be updated. In summary 1) this isn't a duplicate 2) it isn't fixed in F30, 3) some additional work needs to be done to make this work on real systems. Have you tried running with gdm-password in /etc/pam.d/xrdp-sesman (i.e. the commented out bits put in by the package)? I don't have SELinux issues when trying to run xrdp/Gnome on F30 EC2 with SELinux enabled. If you don't relabel xrdp-sesman and add the selinux pam your session will be running as unconfined_service_t which may work for you, but is decidedly not what I'm going for. I need my user sessions to be correctly labeled for that particular user (we aren't using unconfined, we have users with explicit user domains). |