Bug 697480

Summary: SELinux is preventing /usr/bin/ssh-keygen from write access on the file /tmp/sh-thd-1303119653.
Product: [Fedora] Fedora Reporter: Wolfgang Rupprecht <wolfgang.rupprecht>
Component: opensshAssignee: Petr Lautrbach <plautrba>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: dwalsh, mattias.ellert, mgrepl, rvokal, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-16 15:05:40 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 Flags
sshd config file none

Description Wolfgang Rupprecht 2011-04-18 12:35:11 UTC
Description of problem:
SELinux is preventing /usr/bin/ssh-keygen from write access on the file /tmp/sh-thd-1303119653.

*****  Plugin leaks (50.5 confidence) suggests  ******************************

If you want to ignore ssh-keygen trying to write access the sh-thd-1303119653 file, because you believe it should not need this access.
Then you should report this as a bug.  
You can generate a local policy module to dontaudit this access.
Do
# grep /usr/bin/ssh-keygen /var/log/audit/audit.log | audit2allow -D -M mypol
# semodule -i mypol.pp

*****  Plugin catchall (50.5 confidence) suggests  ***************************

If you believe that ssh-keygen should be allowed write access on the sh-thd-1303119653 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 ssh-keygen /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:ssh_keygen_t:s0
Target Context                system_u:object_r:initrc_tmp_t:s0
Target Objects                /tmp/sh-thd-1303119653 [ file ]
Source                        ssh-keygen
Source Path                   /usr/bin/ssh-keygen
Port                          <Unknown>
Host                          arbol.wsrcc.com
Source RPM Packages           openssh-5.5p1-24.fc14.2
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-37.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     arbol.wsrcc.com
Platform                      Linux arbol.wsrcc.com 2.6.35.12-88.fc14.x86_64 #1
                              SMP Thu Mar 31 21:21:57 UTC 2011 x86_64 x86_64
Alert Count                   8
First Seen                    Mon 11 Apr 2011 07:56:06 AM PDT
Last Seen                     Mon 18 Apr 2011 03:52:30 AM PDT
Local ID                      a3fc341e-5b6e-4291-9117-55783f653168

Raw Audit Messages
type=AVC msg=audit(1303123950.376:13): avc:  denied  { write } for  pid=2601 comm="ssh-keygen" path="/tmp/sh-thd-1303119653" dev=tmpfs ino=17160 scontext=system_u:system_r:ssh_keygen_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=file


type=SYSCALL msg=audit(1303123950.376:13): arch=x86_64 syscall=execve success=yes exit=0 a0=1c1aa00 a1=1c1b2a0 a2=1c1cfb0 a3=8 items=0 ppid=2600 pid=2601 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=ssh-keygen exe=/usr/bin/ssh-keygen subj=system_u:system_r:ssh_keygen_t:s0 key=(null)

Hash: ssh-keygen,ssh_keygen_t,initrc_tmp_t,file,write

audit2allow

#============= ssh_keygen_t ==============
allow ssh_keygen_t initrc_tmp_t:file write;

audit2allow -R

#============= ssh_keygen_t ==============
allow ssh_keygen_t initrc_tmp_t:file write;



Version-Release number of selected component (if applicable):
selinux-policy-3.9.7-37.fc14

How reproducible:
I'm guessing all the time.

Steps to Reproduce:
1.  Enable sshd and reboot
2.
3.
  
Actual results:
Selinux blocks something sshd thinks it needs.

Expected results:
Selinux shouldn't block anything sshd thinks it needs.

Additional info:

Comment 1 Wolfgang Rupprecht 2011-04-18 12:40:58 UTC
Created attachment 492887 [details]
sshd config file

I'm not sure it matters for reproducing the bug, but here is the sshd config file in use.

Comment 2 Daniel Walsh 2011-04-18 16:04:00 UTC
This looks like someone is doing some bash redirection around this script which is causing the problem.

It can safely be ignored.  Something like.

sh << _EOF
sshkeygen
_EOF

Comment 3 Fedora Admin XMLRPC Client 2011-11-30 12:26:14 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Fedora End Of Life 2012-08-16 15:05:44 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached 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 to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

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.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping