Bug 1429126 - The SELinux policy is matching ejabberdctl as rabbitmq_t and doesn't work
Summary: The SELinux policy is matching ejabberdctl as rabbitmq_t and doesn't work
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 27
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1424823
TreeView+ depends on / blocked
 
Reported: 2017-03-04 19:22 UTC by Randy Barlow
Modified: 2018-11-30 22:34 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-11-30 22:34:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Randy Barlow 2017-03-04 19:22:24 UTC
Description of problem:
Hello!

I've been trying to figure out how to start ejabberd with SELinux enforcing:

https://bugzilla.redhat.com/show_bug.cgi?id=1424823

One thing that's kind of weird about this is that the SELinux policy is matching ejabberd as RabbitMQ, but the policy doesn't allow ejabberd to do all the things it needs to do to work. To work around this, a previous developer had altered ejabberd's unit file to launch ejabberdctl with /usr/bin/bash so it would launch as init_t instead of as rabbitmq_t, but that stopped working in Fedora 26.

I'd like to solve this, so I started working on writing ejabberd its own policy today, but my system won't allow me to match /usr/bin/ejabberdctl since that is already matched by rabbitmq_exec_t:

$ sudo semodule -i ejabberd.pp                              
/var/lib/selinux/final/targeted/contexts/files/file_contexts: Multiple different specifications for /usr/bin/ejabberdctl  (system_u:object_r:rabbitmq_exec_t:s0 and system_u:object_r:ejabberd_exec_t:s0).
/var/lib/selinux/final/targeted/contexts/files/file_contexts: Invalid argument
libsemanage.semanage_validate_and_compile_fcontexts: setfiles returned error code 1.
semodule:  Failed!

What would be the best path forward? Should we just modify the existing rabbitmq_t policy so that it works with ejabberd (including when removing the bash launcher from the systemd unit), or should the rabbitmq policy stop claiming ejabberdctl so that I can write my own policy?


Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-241.fc26.noarch

Comment 1 Randy Barlow 2017-04-05 00:05:15 UTC
I submitted two pull requests to stop the rabbitmq polic from claiming ejabberd for f26 and Rawhide:

https://github.com/fedora-selinux/selinux-policy-contrib/pull/7
https://github.com/fedora-selinux/selinux-policy-contrib/pull/8

Comment 2 Randy Barlow 2017-04-05 13:56:01 UTC
I added a commit in each of those that adds a new policy for ejabberd as well.

Comment 3 Randy Barlow 2017-04-05 14:39:16 UTC
I've also sent the policy to the upstream refpol repo, though I did not fix their RabbitMQ policy as it didn't seem as straightforward and should be fixed by someone more familiar with RabbitMQ.

https://github.com/TresysTechnology/refpolicy-contrib/pull/57

Comment 4 Jan Kurik 2017-08-15 09:15:27 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Comment 5 Ben Cotton 2018-11-27 14:37:35 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Ben Cotton 2018-11-30 22:34:16 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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