Bug 1147787

Summary: zebra won't start when sssd is used due to selinux policy
Product: Red Hat Enterprise Linux 7 Reporter: Kyle Brantley <kyle>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.0CC: mmalik
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.13.1-3.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 10:41:36 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:
Attachments:
Description Flags
ausearch data for denials none

Description Kyle Brantley 2014-09-30 04:08:25 UTC
Description of problem:
zebra attempts to look up the quaggavt group (and other users/groups) upon starting. However, if sssd is used to look up group information, this fails due to selinux policy prohibiting zebra from connecting to the sssd socket.

Version-Release number of selected component (if applicable):
selinux-policy-3.12.1-153.el7_0.11.noarch
quagga-0.99.22.4-4.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Install both quagga and sssd
2. Configure the system to leverage sssd for user/group lookups
3. `systemctl start zebra`

Actual results:
* syslog:
Sep 30 03:29:39 el7 systemd[1]: Starting GNU Zebra routing manager...
Sep 30 03:29:39 el7 zebra[12271]: privs_init: could not lookup vty group quaggavt
Sep 30 03:29:39 el7 systemd[1]: zebra.service: control process exited, code=exited status=1
Sep 30 03:29:39 el7 systemd[1]: Failed to start GNU Zebra routing manager.
Sep 30 03:29:39 el7 systemd[1]: Unit zebra.service entered failed state.

* audit.log:
type=AVC msg=audit(1412048559.737:1753): avc:  denied  { search } for  pid=21592 comm="zebra" name="sss" dev="dm-0" ino=4549 scontext=system_u:system_r:zebra_t:s0 tcontext=system_u:object_r:sssd_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1412048781.198:1762): avc:  denied  { search } for  pid=22029 comm="zebra" name="mc" dev="dm-0" ino=4551 scontext=system_u:system_r:zebra_t:s0 tcontext=system_u:object_r:sssd_public_t:s0 tclass=dir
type=AVC msg=audit(1412048781.198:1762): avc:  denied  { read } for  pid=22029 comm="zebra" name="group" dev="dm-0" ino=13411 scontext=system_u:system_r:zebra_t:s0 tcontext=system_u:object_r:sssd_public_t:s0 tclass=file
type=AVC msg=audit(1412048781.198:1762): avc:  denied  { open } for  pid=22029 comm="zebra" path="/var/lib/sss/mc/group" dev="dm-0" ino=13411 scontext=system_u:system_r:zebra_t:s0 tcontext=system_u:object_r:sssd_public_t:s0 tclass=file
type=AVC msg=audit(1412048781.199:1763): avc:  denied  { getattr } for  pid=22029 comm="zebra" path="/var/lib/sss/mc/group" dev="dm-0" ino=13411 scontext=system_u:system_r:zebra_t:s0 tcontext=system_u:object_r:sssd_public_t:s0 tclass=file
type=AVC msg=audit(1412048781.200:1764): avc:  denied  { write } for  pid=22029 comm="zebra" name="nss" dev="dm-0" ino=13370 scontext=system_u:system_r:zebra_t:s0 tcontext=system_u:object_r:sssd_var_lib_t:s0 tclass=sock_file
type=AVC msg=audit(1412048781.200:1764): avc:  denied  { connectto } for  pid=22029 comm="zebra" path="/var/lib/sss/pipes/nss" scontext=system_u:system_r:zebra_t:s0 tcontext=system_u:system_r:sssd_t:s0 tclass=unix_stream_socket
type=AVC msg=audit(1412049086.717:1771): avc:  denied  { search } for  pid=22072 comm="zebra" name="sss" dev="dm-0" ino=4549 scontext=system_u:system_r:zebra_t:s0 tcontext=system_u:object_r:sssd_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1412049086.718:1772): avc:  denied  { search } for  pid=22072 comm="zebra" name="sss" dev="dm-0" ino=4549 scontext=system_u:system_r:zebra_t:s0 tcontext=system_u:object_r:sssd_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1412049127.925:1776): avc:  denied  { search } for  pid=22081 comm="zebra" name="sss" dev="dm-0" ino=4549 scontext=system_u:system_r:zebra_t:s0 tcontext=system_u:object_r:sssd_var_lib_t:s0 tclass=dir
type=AVC msg=audit(1412049127.925:1777): avc:  denied  { search } for  pid=22081 comm="zebra" name="sss" dev="dm-0" ino=4549 scontext=system_u:system_r:zebra_t:s0 tcontext=system_u:object_r:sssd_var_lib_t:s0 tclass=dir



Expected results:
Running zebra daemon.

Additional info:
Courtesy of audit2allow:

require {
        type sssd_t;
        type sssd_var_lib_t;
        type sssd_public_t;
        type zebra_t;
        class sock_file write;
        class unix_stream_socket connectto;
        class file { read getattr open };
        class dir search;
}

#============= zebra_t ==============
allow zebra_t sssd_public_t:dir search;
allow zebra_t sssd_public_t:file { read getattr open };
allow zebra_t sssd_t:unix_stream_socket connectto;
allow zebra_t sssd_var_lib_t:dir search;
allow zebra_t sssd_var_lib_t:sock_file write;

Comment 2 Kyle Brantley 2014-10-01 04:18:19 UTC
Created attachment 942911 [details]
ausearch data for denials

Comment 3 Milos Malik 2014-10-01 18:38:18 UTC
Thanks for your report, the same problem is present on RHEL-6.6 (BZ#1148572).

Comment 4 Miroslav Grepl 2014-10-02 09:18:26 UTC
commit 38c83b21621ea0c0a83c297ddd6f5df1a9cac2cd
Author: Miroslav Grepl <mgrepl>
Date:   Thu Oct 2 11:12:27 2014 +0200

    ALlow zebra for user/group look-ups.

Comment 8 errata-xmlrpc 2015-03-05 10:41:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0458.html