Bug 600651 - gitolite prohibited from authenticating users ssh keys.
gitolite prohibited from authenticating users ssh keys.
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
13
All Linux
low Severity medium
: ---
: ---
Assigned To: Miroslav Grepl
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-05 08:40 EDT by john5342
Modified: 2010-06-23 13:48 EDT (History)
1 user (show)

See Also:
Fixed In Version: selinux-policy-3.7.19-28.fc13
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-06-23 13:48:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description john5342 2010-06-05 08:40:07 EDT
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 09:46:40 EDT
# 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 09:49:55 EDT
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 07:26:05 EDT
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 08:05:10 EDT
Ok I will wait for the patch
Comment 5 Miroslav Grepl 2010-06-08 08:55:29 EDT
Fixed in selinux-policy-3.7.19-25.fc13
Comment 6 Fedora Update System 2010-06-14 15:30:15 EDT
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 12:00:14 EDT
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 13:47:10 EDT
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.