Project

Profile

Help

Issue #5995

closed

filecontext conflict with pulp2

Added by evgeni almost 5 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Katello, SELinux
Sprint:
Sprint 66
Quarter:

Description

pulp.fc currently defines

/var/lib/pulp(/.*)?     gen_context(system_u:object_r:pulpcore_var_lib_t,s0)

However, pulp-server.fc (https://github.com/pulp/pulp/blob/2-master/server/selinux/server/pulp-server.fc#L6) from pulp2 defines this as:

/var/lib/pulp(/.*)? gen_context(system_u:object_r:httpd_sys_rw_content_t,s0)

I'd expect this makes these two policies not co-installable.

Actions #1

Updated by bmbouter almost 5 years ago

  • Tags Katello-P2 added

Adding P2 label to identify the work priority w.r.t. Katello.

Actions #2

Updated by fao89 almost 5 years ago

  • Triaged changed from No to Yes
Actions #3

Updated by evgeni almost 5 years ago

[root@centos7-katello-3-14 ~]# /usr/sbin/semodule -s  targeted -i /usr/share/selinux/targeted/pulpcore.pp
/etc/selinux/final/targeted/contexts/files/file_contexts: Multiple different specifications for /var/lib/pulp(/.*)?  (system_u:object_r:pulpcore_var_lib_t:s0 and system_u:object_r:httpd_sys_rw_content_t:s0).
/etc/selinux/final/targeted/contexts/files/file_contexts: Invalid argument
libsemanage.semanage_validate_and_compile_fcontexts: setfiles returned error code 1.
/usr/sbin/semodule:  Failed!
Actions #4

Updated by bmbouter almost 5 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to bmbouter
  • Sprint set to Sprint 65

Adding to sprint as it's a Katello blocker.

The plan

We need to update the Pulp2 policy to claim only the folders inside /var/lib/pulp that it needs. Then the pulp3 policy needs to be updated the same.

What are the directory paths Pulp2 uses?
What are the directory paths Pulp3 uses?

Actions #5

Updated by jsherril@redhat.com almost 5 years ago

On my combined pulp2/pulp3 box i see:

artifact
content
importers
init.flag
packages
published
static
tmp
upload
uploads

On my pure pulp2 box i see:

content
importers
init.flag
packages
published
static
uploads
Actions #6

Updated by rchan almost 5 years ago

  • Sprint changed from Sprint 65 to Sprint 66
Actions #7

Updated by dkliban@redhat.com almost 5 years ago

  • Description updated (diff)
  • Assignee changed from bmbouter to dkliban@redhat.com
Actions #8

Updated by dkliban@redhat.com almost 5 years ago

The only overlapping directory is /var/lib/pulp/static/. We should change pulpcore to use /var/lib/pulp/pulpcore-static/ for it's static content. I am open to other name suggestions.

Actions #9

Updated by daviddavis almost 5 years ago

+1 to rename. What about the name 'assets'?

Actions #10

Updated by dkliban@redhat.com almost 5 years ago

I like 'assets'. To be clear, this is only going to change the directory name inside /var/lib/pulp. The URL for the files inside is still going to be /static/.

Added by dkliban@redhat.com almost 5 years ago

Revision c39312b3 | View on GitHub

Renames /var/lib/pulp/static/ to /var/lib/pulp/assets/.

This directory name is already being used by Pulp 2. As a result the SELinux policies for Pulp 2 and Pulp 3 are conflicting. After this change, the two SELinux policies can explicitly name the directories inside /var/lib/pulp/ that they manage.

re: #5995 https://pulp.plan.io/issues/5995

Actions #11

Updated by dkliban@redhat.com almost 5 years ago

Here is the first PR to rename the directory in pulpcore: https://github.com/pulp/pulpcore/pull/533

I also discovered that the installer is not properly configuring nginx and apache to serve the static content: https://pulp.plan.io/issues/6128

Added by dkliban@redhat.com almost 5 years ago

Revision 4b79d71b | View on GitHub

Lists all directories inside /var/lib/pulp/ that are used by pulpcore

This avoids having a conflict with the pulp-server 2.y.z SELinux policy which states:

/var/lib/pulp(/.*)? gen_context(system_u:object_r:httpd_sys_rw_content_t,s0)

re: #5995 https://pulp.plan.io/issues/5995

Actions #12

Updated by dkliban@redhat.com almost 5 years ago

Here is the SELinux policy change PR: https://github.com/pulp/pulpcore-selinux/pull/12

Actions #13

Updated by dkliban@redhat.com almost 5 years ago

  • Status changed from ASSIGNED to MODIFIED
Actions #14

Updated by daviddavis almost 5 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions #15

Updated by daviddavis almost 5 years ago

  • Sprint/Milestone set to 3.2.0
Actions #16

Updated by ggainey over 4 years ago

  • Tags Katello added
  • Tags deleted (Katello-P2)

Also available in: Atom PDF