Bug 1159756 - [RFE] SELinux Support for Ceph MON and OSD processes
Summary: [RFE] SELinux Support for Ceph MON and OSD processes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: RADOS
Version: 1.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: pre-dev-freeze
: 1.3.2
Assignee: Neha Ojha
QA Contact: Pawan
URL:
Whiteboard:
: 1127910 1217816 (view as bug list)
Depends On:
Blocks: 1122184 1127910 1151235 1154725 1171792 1250037 1301187
TreeView+ depends on / blocked
 
Reported: 2014-11-03 09:21 UTC by Neil Levine
Modified: 2022-02-21 18:20 UTC (History)
30 users (show)

Fixed In Version: RHEL: ceph-0.94.5-1.el7cp
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-29 14:40:27 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Ceph Project Bug Tracker 8731 0 None None None Never
Ceph Project Bug Tracker 9931 0 None None None Never
Red Hat Bugzilla 1154725 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Bugzilla 1349194 0 high CLOSED SELinux on Ceph OSD nodes should be in enforcing mode 2021-02-22 00:41:40 UTC
Red Hat Issue Tracker RHCEPH-3361 0 None None None 2022-02-21 18:20:04 UTC
Red Hat Product Errata RHBA-2016:0313 0 normal SHIPPED_LIVE Red Hat Ceph Storage 1.3.2 bug fix and enhancement update 2016-02-29 19:37:43 UTC

Internal Links: 1154725 1349194

Description Neil Levine 2014-11-03 09:21:12 UTC
SELinux policy rules are needed for the main RADOS processes (OSD and MON).

Comment 1 Ken Dreyer (Red Hat) 2015-04-08 15:03:02 UTC
Our test labs don't have support for SELinux so there's no way to test this with any reasonable level of confidence. Re-targeting to 1.3.1 for now.

Comment 2 Harish NV Rao 2015-04-16 06:51:47 UTC
Since this is targeted for 1.3.1, QE will provide ACK during 1.3.1 time.

Comment 3 Sage Weil 2015-05-01 16:40:06 UTC
We should be able to test selinux in the octo lab on the el7 machines.. unless there is some other issue I'm not aware of?

Comment 4 Ken Dreyer (Red Hat) 2015-05-01 17:55:56 UTC
(In reply to Sage Weil from comment #3)
> We should be able to test selinux in the octo lab on the el7 machines..
> unless there is some other issue I'm not aware of?

I'm sure we could turn it on across the octo lab to find out what breaks. Some potential issues come to mind:

- Ideally Teuthology itself would not set off any AVC denial errors. 
- teuthology-nuke has no ability to reset SELinux settings to a known state. Maybe re-imaging is really our best operation there, since relabling the whole filesystem can also take a while.
- It would also be great to make Teuthology use the packaging init scripts for RGW so that daemon runs in the same SELinux context that a user will use. (I am not sure if Teuthology does this for Ceph, either?)

Comment 5 Neil Levine 2015-05-01 18:01:18 UTC
*** Bug 1127910 has been marked as a duplicate of this bug. ***

Comment 6 Zack Cerza 2015-05-06 16:19:23 UTC
(In reply to Ken Dreyer (Red Hat) from comment #4)
> (In reply to Sage Weil from comment #3)
> > We should be able to test selinux in the octo lab on the el7 machines..
> > unless there is some other issue I'm not aware of?
> 
> I'm sure we could turn it on across the octo lab to find out what breaks.
> Some potential issues come to mind:

It's my understanding that setting it to use permissive mode would log would-be denials, while not actually denying anything. I can trivially change our kickstart template to do this for all new reimages. We could also probably modify existing systems to enable selinux, though I'm not sure if that would cause strange behavior.

> - Ideally Teuthology itself would not set off any AVC denial errors. 
> - teuthology-nuke has no ability to reset SELinux settings to a known state.
> Maybe re-imaging is really our best operation there, since relabling the
> whole filesystem can also take a while.

Relabling would almost certainly take far less time than reimaging. A relabel can be accomplished by a simple 'touch /.autorelabel && reboot'.

> - It would also be great to make Teuthology use the packaging init scripts
> for RGW so that daemon runs in the same SELinux context that a user will
> use. (I am not sure if Teuthology does this for Ceph, either?)

Currently we wrap each call to a daemon with three different shell/python scripts. Given that, I don't know how feasible it would be to use the standard init scripts.

Comment 7 Sage Weil 2015-05-06 16:26:11 UTC
(In reply to Zack Cerza from comment #6)
> (In reply to Ken Dreyer (Red Hat) from comment #4)
> > (In reply to Sage Weil from comment #3)
> > > We should be able to test selinux in the octo lab on the el7 machines..
> > > unless there is some other issue I'm not aware of?
> > 
> > I'm sure we could turn it on across the octo lab to find out what breaks.
> > Some potential issues come to mind:
> 
> It's my understanding that setting it to use permissive mode would log
> would-be denials, while not actually denying anything. I can trivially
> change our kickstart template to do this for all new reimages. We could also
> probably modify existing systems to enable selinux, though I'm not sure if
> that would cause strange behavior.

We'd probably want to make this optional.. like maybe an selinux.py task that enables permissive (or another node) during setup and on cleanup checks for errors.

> > - It would also be great to make Teuthology use the packaging init scripts
> > for RGW so that daemon runs in the same SELinux context that a user will
> > use. (I am not sure if Teuthology does this for Ceph, either?)
> 
> Currently we wrap each call to a daemon with three different shell/python
> scripts. Given that, I don't know how feasible it would be to use the
> standard init scripts.

Yeah :(.  The ceph-deploy exercises the normal init scripts though... that might be the way to go for this.

Comment 8 Ken Dreyer (Red Hat) 2015-05-06 17:21:42 UTC
(In reply to Zack Cerza from comment #6)
> Relabling would almost certainly take far less time than reimaging. A
> relabel can be accomplished by a simple 'touch /.autorelabel && reboot'.

Ok, that's fair. The reason I proposed re-imaging is that we'd also want to be sure we reset all selinux booleans to the factory defaults. I don't know a way to do that.

Comment 9 Boris Ranto 2015-05-18 19:38:38 UTC
@Ken: 'semanage export' will tell you what all your local SELinux customizations are (not just booleans). You can also check the output of 'semanage boolean -lC' that will show you the locally customized booleans.

Finally, you can even use 'semanage boolean -D' to remove all the local boolean modifications.

Comment 10 Lukas Vrabec 2015-08-04 12:27:38 UTC
*** Bug 1250037 has been marked as a duplicate of this bug. ***

Comment 12 Milan Broz 2015-08-04 14:42:17 UTC
*** Bug 1127910 has been marked as a duplicate of this bug. ***

Comment 13 Ken Dreyer (Red Hat) 2015-12-11 21:12:20 UTC
*** Bug 1217816 has been marked as a duplicate of this bug. ***

Comment 18 arkady kanevsky 2016-01-21 15:27:43 UTC
Will this fix be part of Ceph only? Or will it become part of RHEL and Atomic?
Do we know which version of OSP (OSP-D) is targeted to integrate this fix?
We can file a separate BZ for tracking OSP integration.

Comment 20 Ken Dreyer (Red Hat) 2016-02-16 16:24:04 UTC
(In reply to arkady kanevsky from comment #18)
> Will this fix be part of Ceph only? Or will it become part of RHEL and
> Atomic?

It will be a part of Ceph only.

> Do we know which version of OSP (OSP-D) is targeted to integrate this fix?

This bug doesn't relate to any OSP code, only Ceph. So as soon as the Ceph product ships a build with a fix, then it's available to all customers, OSP included.

Comment 21 Ken Dreyer (Red Hat) 2016-02-16 16:25:25 UTC
(In reply to Ken Dreyer (Red Hat) from comment #20)
> (In reply to arkady kanevsky from comment #18)
> > Do we know which version of OSP (OSP-D) is targeted to integrate this fix?
> 
> This bug doesn't relate to any OSP code, only Ceph. So as soon as the Ceph
> product ships a build with a fix, then it's available to all customers, OSP
> included.

Sorry, I realized that maybe you meant "when will OSP Director handle the installation of the ceph-selinux package". That I don't know - it would be good to file a BZ against OSP-D for that.

Comment 22 Harish NV Rao 2016-02-17 09:26:34 UTC
Fixed. Moving to verified state.

Comment 24 errata-xmlrpc 2016-02-29 14:40:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:0313


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