Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 921125

Summary: selinux blocks facter from gathering gear statistics
Product: OpenShift Container Platform Reporter: Luke Meyer <lmeyer>
Component: ContainersAssignee: Brenton Leanhardt <bleanhar>
Status: CLOSED DUPLICATE QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 1.1.1CC: libra-onpremise-devel
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-13 14:32:04 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 Luke Meyer 2013-03-13 14:13:16 UTC
Description of problem:
Getting AVC denials in the audit.log from the cron job that gathers mcollective facts. Apparently only part of the facts aren't being gathered - the gear counts.

Version-Release number of selected component (if applicable):
http://buildvm-devops.usersys.redhat.com/puddle/build/OpenShiftEnterprise/1.1.z/2013-03-06.1/
openshift-origin-msg-node-mcollective-1.0.3-1.el6op.noarch
selinux-policy-3.7.19-195.el6_4.2.noarch


Steps to Reproduce:
1. Create an OSE installation
2. Create some apps
3. Wait for mcollective facter to run (do not run as root)
3. grep gears /etc/mcollective/facts.yaml
  
Actual results:
all zeroes

Expected results:
positive numbers at least for e.g. gears_total_count

Additional info:
The problem appears to stem from this line of code (where app_dir iterates over the gear directories):

Dir.glob(File.join(app_dir, %w{app-root runtime .state})).each do |file|

This line however succeeds in counting git repositories:

git_repos_count += Dir.glob(File.join(app_dir, "git/*.git")).count

Selinux contexts:
system_u:object_r:openshift_var_lib_t:s0:c0,c1002 /var/lib/openshift/1db5352de6864a7592c9b56252beff9c/app-root/runtime/
system_u:object_r:openshift_var_lib_t:s0:c0,c1002 /var/lib/openshift/1db5352de6864a7592c9b56252beff9c/app-root/runtime/.state
system_u:object_r:openshift_var_lib_t:s0:c0,c1002 /var/lib/openshift/1db5352de6864a7592c9b56252beff9c/git
system_u:object_r:openshift_var_lib_t:s0:c0,c1002 /var/lib/openshift/1db5352de6864a7592c9b56252beff9c/git/1db5352de6.git/

Running the audit.log through audit2allow gives the following policy:
#============= openshift_cron_t ==============
allow openshift_cron_t self:capability { dac_read_search dac_override };

Comment 1 Luke Meyer 2013-03-13 14:14:15 UTC
My devenv does not seem to have this problem.

Comment 3 Luke Meyer 2013-03-13 14:32:04 UTC

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