Bug 600651 - gitolite prohibited from authenticating users ssh keys.
Summary: gitolite prohibited from authenticating users ssh keys.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-05 12:40 UTC by john5342
Modified: 2010-06-23 17:48 UTC (History)
1 user (show)

Fixed In Version: selinux-policy-3.7.19-28.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-06-23 17:48:43 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description john5342 2010-06-05 12:40:07 UTC
Summary:

SELinux is preventing /usr/sbin/sshd "read" access on
/var/lib/gitolite/.ssh/authorized_keys.

Detailed Description:

SELinux denied access requested by sshd. It is not expected that this access is
required by sshd and this access may signal an intrusion attempt. It is also
possible that the specific version or configuration of the application is
causing it to require additional access.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://docs.fedoraproject.org/selinux-faq-fc5/#id2961385) Please file a bug
report.

Additional Information:

Source Context                unconfined_u:system_r:sshd_t:s0-s0:c0.c1023
Target Context                system_u:object_r:var_lib_t:s0
Target Objects                /var/lib/gitolite/.ssh/authorized_keys [ file ]
Source                        sshd
Source Path                   /usr/sbin/sshd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           openssh-server-5.4p1-2.fc13
Target RPM Packages           gitolite-1.4.2-1.fc13
Policy RPM                    selinux-policy-3.7.19-21.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux localhost.localdomain
                              2.6.33.5-112.fc13.x86_64 #1 SMP Thu May 27
                              02:28:31 UTC 2010 x86_64 x86_64
Alert Count                   2
First Seen                    Sat 05 Jun 2010 03:45:41 AM BST
Last Seen                     Sat 05 Jun 2010 01:20:20 PM BST
Local ID                      046386d4-5dd4-40ec-89a3-1d2a53fcccbc
Line Numbers                  

Raw Audit Messages            

node=localhost.localdomain type=AVC msg=audit(1275740420.70:34): avc:  denied  { read } for  pid=2463 comm="sshd" name="authorized_keys" dev=sdc3 ino=8137093 scontext=unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_lib_t:s0 tclass=file

node=localhost.localdomain type=SYSCALL msg=audit(1275740420.70:34): arch=c000003e syscall=2 success=no exit=-13 a0=7f55ac4e5400 a1=800 a2=1 a3=7fff50edc470 items=0 ppid=2459 pid=2463 auid=500 uid=0 gid=0 euid=491 suid=0 fsuid=491 egid=479 sgid=0 fsgid=479 tty=(none) ses=1 comm="sshd" exe="/usr/sbin/sshd" subj=unconfined_u:system_r:sshd_t:s0-s0:c0.c1023 key=(null)


This issue seems to be identical to [1]. Gitolite is a rewrite of gitosis so it shares the same basic structure and requirements as gitosis too. Probably fix_for_gitosis > s/gitosis/gitolite/

[1] - https://bugzilla.redhat.com/show_bug.cgi?id=470514

Comment 1 Daniel Walsh 2010-06-07 13:46:40 UTC
# semanage fcontext -a -t home_ssh_t ' /var/lib/gitolite/.ssh(/.*)?'
# restorecon -R -v  /var/lib/gitolite/.ssh


Should fix.

Miroslav can you make this the default.

Comment 2 Daniel Walsh 2010-06-07 13:49:55 UTC
Should be 

# semanage fcontext -a -t home_ssh_t '/var/lib/gitolite/.ssh(/.*)?'
# restorecon -R -v  /var/lib/gitolite/.ssh

Comment 3 Miroslav Grepl 2010-06-08 11:26:05 UTC
Dan,
we can combine gitosis and gitolite policy and run gitolite in the gitosis domain. Only some changes are needed (I will send you a patch).

Also I would label '/var/lib/gitolite' directory as gitosis_var_lib_t and it will work.

Comment 4 Daniel Walsh 2010-06-08 12:05:10 UTC
Ok I will wait for the patch

Comment 5 Miroslav Grepl 2010-06-08 12:55:29 UTC
Fixed in selinux-policy-3.7.19-25.fc13

Comment 6 Fedora Update System 2010-06-14 19:30:15 UTC
selinux-policy-3.7.19-28.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/selinux-policy-3.7.19-28.fc13

Comment 7 Fedora Update System 2010-06-15 16:00:14 UTC
selinux-policy-3.7.19-28.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/selinux-policy-3.7.19-28.fc13

Comment 8 Fedora Update System 2010-06-23 17:47:10 UTC
selinux-policy-3.7.19-28.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.