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

Bug 1117442

Summary: custom selinux policy for gear syslogs
Product: OpenShift Container Platform Reporter: Luke Meyer <lmeyer>
Component: DocumentationAssignee: Alex Dellapenta <adellape>
Status: CLOSED CURRENTRELEASE QA Contact: Bilhar <baulakh>
Severity: medium Docs Contact:
Priority: high    
Version: 2.1.0CC: agoldste, bleanhar, jdetiber, jialiu, jkeck, jokerman, libra-bugs, libra-onpremise-devel, lmeyer, mmccomas, pruan, xiama
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1096155 Environment:
Last Closed: 2014-12-11 20:15:42 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:
Bug Depends On: 1096155, 1108367, 1117360    
Bug Blocks:    

Description Luke Meyer 2014-07-08 17:27:01 UTC
⁠8.5.4. Enabling Syslog for Cartridge Logs from Gears
Procedure 8.6. To Enable Application and Gear Context for Cartridge Logs

+++ Docs to support Bug #1096155 +++

In order to resolve the problem in bug 1096155, custom SELinux policy is required until it can be shipped as part of RHEL. This should be noted somewhere in this section.

When a gear is created on a node host with a particular UID, and gears are set up to log to the syslog, the syslog mmopenshift module caches gear environment variables to avoid having to look them up for every log entry. The problem comes when this gear is destroyed and later replaced by another with the same UID. Due to the bug, the logging cache is never cleared so the logs for the new gear appear with the context identifying it as the old one.

The necessary SELinux policy module is as follows:

module rsyslog7-mmopenshift 1.0;
require {
        type syslogd_t;
        type inotifyfs_t;
        class dir read;
}
#============= syslogd_t ==============
# enable rsyslog7-mmopenshift to receive inotify events so that when 
# a gear is removed, the cached context for its UID can also be removed.
allow syslogd_t inotifyfs_t:dir read;

------------------------------

https://github.com/openshift/openshift-extras/pull/398/files indicates how to compile and install this module. This docs section should indicate how to do this.

Once rsyslog7-7.4.7-5.7.el6op ships (should be OSE 2.1.3), that combined with the updated policy will address the bug.

Once an updated selinux-policy RPM ships with RHEL (> selinux-policy-3.7.19-237.el6), this step will no longer be necessary.

Comment 2 Alex Dellapenta 2014-12-11 20:15:42 UTC
With the release of https://bugzilla.redhat.com/show_bug.cgi?id=1108367, this docs BZ is no longer necessary.