Bug 969485

Summary: mcollective service contexts
Product: Red Hat Enterprise Linux 6 Reporter: Markus Nussdorfer <markus.nussdorfer>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4CC: dwalsh, lnovich, mmalik
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.7.19-203.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-21 10:30:07 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 Markus Nussdorfer 2013-05-31 14:13:44 UTC
Description of problem:

openshift semodules causes troubles with service restarts through mcollective service plugin

Version-Release number of selected component (if applicable):

selinux-policy-3.7.19-195.el6_4.5.noarch
selinux-policy-targeted-3.7.19-195.el6_4.5.noarch

packages from puppetlabs
mcollective-service-agent-3.1.2-1.noarch
mcollective-service-common-3.1.2-1.noarch
mcollective-2.2.3-1.el6.noarch

How reproducible:

system running with selinux enabled

Steps to Reproduce:
1. service mcollective start

   ps -efZ mcollective
   system_u:system_r:openshift_initrc_t:s0-s0:c0.c1023 root 29398 1  0 May17 ? 00:20:24 ruby /usr/sbin/mcollectived --pid=/var/run/mcollectived.pid --config=/etc/mcollective/server.cfg

2. mco service abrtd restart


Actual results:
ps -efZ|grep abrtd
   system_u:system_r:openshift_initrc_t:s0-s0:c0.c1023 root 30589 1  0 May28 ? 00:00:00 /usr/sbin/abrtd

Expected results:
ps -efZ|grep abrtd
   system_u:system_r:abrt_t:s0-s0:c0.c1023 root 1826  1  0 02:33 ?        00:00:00 /usr/sbin/abrtd

Additional info:

Tested with different services and show the same results
all restarted processes run under the same context as mcollectived and causes severe problems.
in case of ssh no login possible

When disabling openshift and openshift-origin, the restarted processes get the correct context

semodule -d openshift openshift-origin

ps -efZ|grep mcollective
unconfined_u:system_r:initrc_t:s0 root    9516     1  0 10:57 ?        00:00:12 ruby /usr/sbin/mcollectived --pid=/var/run/mcollectived.pid --config=/etc/mcollective/server.cfg

Comment 2 Miroslav Grepl 2013-06-04 12:16:15 UTC
Could you please re-test it with the following local policy

# cat mypol.te
policy_module(mypol,1.0)

require{
 type openshift_initrc_t;
}

init_domtrans_script(openshift_initrc_t)
init_initrc_domain(openshift_initrc_t)


and execute

# make -f /usr/share/selinux/devel/Makefile mypol.pp
# semodule -i mypol.pp

and run your test scenario. Thank you.

Comment 3 Markus Nussdorfer 2013-06-04 21:44:00 UTC
(In reply to Miroslav Grepl from comment #2)

Did the tests with the module and it is working as expected.

Thanks Markus

Comment 4 Miroslav Grepl 2013-06-05 11:04:20 UTC
I added fixes.

Comment 11 errata-xmlrpc 2013-11-21 10:30:07 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.

http://rhn.redhat.com/errata/RHBA-2013-1598.html