SELINUX context continuously reset on /etc/group

Solution In Progress - Updated -

Environment

  • OpenShift Enterprise 2.1

Issue

  • We've noticed a disturbing pattern w/ regard to the SELINUX context and /etc/group. It appears that it continuously gets reset and we're trying to determine if this is someting in our environment
    • Essentially, on the nodes occasionally (once a week or every other week / once a month, too infrequent to measure)... we need to re-run restorecon /etc/group. Essentially this locks out creation of new gears until SELINUX is restored to /etc/group.
Could not create application eapptest
Could not request https://BROKER.DOMAIN/broker/rest/domain/dmn/applications?include=cartridges: ERROR: unable to create user group(10): groupadd -g 34718 GEAR_UUID stdout:  stderr: groupadd: cannot open /etc/group

Root Cause

  • Normal context:
-rw-r--r--. root root system_u:object_r:etc_t:s0 /etc/group
  • Broken context:
-rw-r--r--. root root system_u:object_r:etc_runtime_t:s0 /etc/group
- it changes /etc/group so that **etc_t** is actually **etc_runtime_t**.

Diagnostic Steps

  • Set up an Auditd rule to watch for a change and then us ausearch to determine what is making the change.
# auditctl -w /etc/group -p rwxa -k watch_group
# ausearch -if /var/log/audit/audit.log -k watch_group -sc setxattr

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.