Bug 1270330

Summary: selinux appears to block sshd ForwardX11/xauth
Product: Red Hat Enterprise Linux 7 Reporter: Pat Riehecky <riehecky>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NEXTRELEASE QA Contact: Milos Malik <mmalik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: csieh, lvrabec, mgrepl, misterbonnie, mmalik, plautrba, pvrabec, ssekidde
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-12 07:58:58 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 Pat Riehecky 2015-10-09 16:19:44 UTC
Description of problem:
AVC denial messages appear when setting up xauth cookies.

Version-Release number of selected component (if applicable):selinux-policy-3.13.1-23.el7_1.18.noarch


How reproducible:100%


Steps to Reproduce:
1.set selinux to enforcing
2.enable ForwardX11 for sshd
3.ssh into system with -X
4.review audit log

Actual results:
selinux error

Expected results:
perhaps a boolean to enable this behavior?

Additional info:

SELinux is preventing /usr/sbin/sshd from 'write' accesses on the key Unknown.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that sshd should be allowed write access on the Unknown key 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 sshd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:sshd_t:s0-s0:c0.c1023
Target Context                system_u:system_r:xdm_t:s0-s0:c0.c1023
Target Objects                Unknown [ key ]
Source                        sshd
Source Path                   /usr/sbin/sshd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           openssh-server-6.6.1p1-12.el7_1.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-23.el7_1.18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.10.0-229.14.1.el7.x86_64 #1 SMP
                              Tue Sep 15 05:09:55 CDT 2015 x86_64 x86_64
Alert Count                   1
First Seen                    2015-10-09 11:09:09 CDT
Last Seen                     2015-10-09 11:09:09 CDT
Local ID                      deb04197-f3f9-43c3-8acd-3fd9251ca7f1

Raw Audit Messages
type=AVC msg=audit(1444406949.833:8562): avc:  denied  { write } for  pid=6002 comm="sshd" scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:system_r:xdm_t:s0-s0:c0.c1023 tclass=key


type=SYSCALL msg=audit(1444406949.833:8562): arch=x86_64 syscall=add_key success=yes exit=1004727405 a0=7fbf5a6ad4ec a1=7fbf5d5615b0 a2=0 a3=0 items=0 ppid=1 pid=6002 auid=4294967295 uid=0 gid=0 euid=1000 suid=0 fsuid=1000 egid=1000 sgid=0 fsgid=1000 tty=(none) ses=4294967295 comm=sshd exe=/usr/sbin/sshd subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 key=(null)

Hash: sshd,sshd_t,xdm_t,key,write

Comment 3 Miroslav Grepl 2015-10-12 07:58:58 UTC
It is going to be addressed in RHEL-7.2. Closing as NEXTRELEASE.