Bug 915370 - oo-cgroup-read fails, generates AVC
Summary: oo-cgroup-read fails, generates AVC
Keywords:
Status: CLOSED DUPLICATE of bug 912215
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Linux
high
medium
Target Milestone: ---
: ---
Assignee: Rob Millner
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-25 15:33 UTC by Mark Lamourine
Modified: 2015-05-14 23:05 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-26 20:02:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 912215 0 high CLOSED builds fail on jboss with oo-ruby: Permission denied [was: open4 LoadError continuously seen when oo-cgroup-read action ... 2021-02-22 00:41:40 UTC

Internal Links: 912215

Description Mark Lamourine 2013-02-25 15:33:14 UTC
Description of problem:

oo-cgroup-read is used to allow gear owners to check their cgroup settings and statistics.  oo-cgroup-read is a shell script that attempts to run cgget.  Current SELinux policy prevents oo-cgroup-read from executing additional programs.

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


How reproducible:

On Fedora 18 with Openshift Origin installed from source after Feb 19:
commit: 2f82b1a6c25db57a5c7728c18bc22e2f7b6c7350

Run smoke tests


Steps to Reproduce:
1. Try building a jbossas application
2. run 'oo-cgroup-read"

Actual results:

Tested on devenv_2829

Now, the LoadError is gone, the code uses oo-ruby instead of ruby to resolve the problem.
But SELinux issues arose. The gear owner can not perform oo-cgroup-read

[jbossas1-2829t.dev.rhcloud.com ~]\> oo-cgroup-read memory.memsw.limit_in_bytes
/usr/bin/env: oo-ruby: Permission denied

[root@ip-10-151-84-246 ~]# ll -Z /usr/bin/oo-cgroup-read
-rwxr-xr-x. root root system_u:object_r:openshift_cgroup_read_exec_t:s0 /usr/bin/oo-cgroup-read


Expected results:

oo-cgroup-read prints the current value of memory.memsw.limit_in_bytes



Additional info:

The recent change added a call out to cgget, where before it used a file read.
This requires that the script be able to execute an external program (cgget).

I think we need the rule described below added to the openshift-origin policy.

jhonce got us this diagnostic:

type=AVC msg=audit(1361291623.691:128914): avc:  denied  { execute } for  pid=4623 comm="oo-cgroup-read" name="bash" dev=xvde1 ino=29 scontext=unconfined_u:system_r:openshift_cgroup_read_t:s0:c0,c501 tcontext=system_u:object_r:shell_exec_t:s0 tclass=file
        Was caused by:
                Missing type enforcement (TE) allow rule.

                You can use audit2allow to generate a loadable module to allow this access.


#============= openshift_cgroup_read_t ==============
allow openshift_cgroup_read_t shell_exec_t:file execute;

Comment 1 Mark Lamourine 2013-02-25 15:34:46 UTC
Related to this bug:

https://bugzilla.redhat.com/show_bug.cgi?id=912215

These changes lead to the new bug.

Comment 2 Rob Millner 2013-02-26 19:58:49 UTC
We need the appropriate policy to run oo-ruby anyway.

Comment 3 Rob Millner 2013-02-26 20:02:03 UTC
Bugzilla ticket 912215 will track solving the new SELinux denial.

*** This bug has been marked as a duplicate of bug 912215 ***


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