Skip to content

Commit 66abe87

Browse files
authored
Merge pull request #10199 from IQSS/10193_Shibboleth_SELinux
document configuring SELinux for Shibboleth
2 parents 8b6737f + dcb2f7d commit 66abe87

File tree

2 files changed

+12
-34
lines changed

2 files changed

+12
-34
lines changed

doc/sphinx-guides/source/developers/selinux.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SELinux
88
Introduction
99
------------
1010

11-
The ``shibboleth.te`` file below that is mentioned in the :doc:`/installation/shibboleth` section of the Installation Guide was created on CentOS 6 as part of https://github.com/IQSS/dataverse/issues/3406 but may need to be revised for future versions of RHEL/CentOS (pull requests welcome!). The file is versioned with the docs and can be found in the following location:
11+
The ``shibboleth.te`` file below that was mentioned in the :doc:`/installation/shibboleth` section of the Installation Guide was created on CentOS 6 as part of https://github.com/IQSS/dataverse/issues/3406 but may need to be revised for future versions of RHEL/CentOS (pull requests welcome!). The file is versioned with the docs and can be found in the following location:
1212

1313
``doc/sphinx-guides/source/_static/installation/files/etc/selinux/targeted/src/policy/domains/misc/shibboleth.te``
1414

doc/sphinx-guides/source/installation/shibboleth.rst

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -205,43 +205,21 @@ The first and easiest option is to set ``SELINUX=permisive`` in ``/etc/selinux/c
205205
Reconfigure SELinux to Accommodate Shibboleth
206206
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
207207

208-
The second (more involved) option is to use the ``checkmodule``, ``semodule_package``, and ``semodule`` tools to apply a local policy to make Shibboleth work with SELinux. Let's get started.
208+
Issue the following commands to allow Shibboleth to function when SELinux is enabled:
209209

210-
Put Type Enforcement (TE) File in misc directory
211-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
212-
213-
Copy and paste or download the :download:`shibboleth.te <../_static/installation/files/etc/selinux/targeted/src/policy/domains/misc/shibboleth.te>` Type Enforcement (TE) file below and put it at ``/etc/selinux/targeted/src/policy/domains/misc/shibboleth.te``.
214-
215-
.. literalinclude:: ../_static/installation/files/etc/selinux/targeted/src/policy/domains/misc/shibboleth.te
216-
:language: text
217-
218-
(If you would like to know where the ``shibboleth.te`` came from and how to hack on it, please see the :doc:`/developers/selinux` section of the Developer Guide. Pull requests are welcome!)
219-
220-
Navigate to misc directory
221-
^^^^^^^^^^^^^^^^^^^^^^^^^^
222-
223-
``cd /etc/selinux/targeted/src/policy/domains/misc``
224-
225-
Run checkmodule
226-
^^^^^^^^^^^^^^^
227-
228-
``checkmodule -M -m -o shibboleth.mod shibboleth.te``
229-
230-
Run semodule_package
231-
^^^^^^^^^^^^^^^^^^^^
232-
233-
``semodule_package -o shibboleth.pp -m shibboleth.mod``
234-
235-
Silent is golden. No output is expected.
236-
237-
Run semodule
238-
^^^^^^^^^^^^
210+
.. code-block:: none
239211
240-
``semodule -i shibboleth.pp``
212+
# Allow httpd to connect to network and read content
213+
sudo /usr/sbin/setsebool -P httpd_can_network_connect 1
214+
sudo /usr/sbin/setsebool -P httpd_read_user_content 1
241215
242-
Silent is golden. No output is expected. This will place a file in ``/etc/selinux/targeted/modules/active/modules/shibboleth.pp`` and include "shibboleth" in the output of ``semodule -l``. See the ``semodule`` man page if you ever want to remove or disable the module you just added.
216+
# Allow httpd to connect to Shib socket
217+
sudo grep httpd_t /var/log/audit/audit.log |/usr/bin/audit2allow -M allow_httpd_shibd_sock
218+
sudo /usr/sbin/semodule -i allow_httpd_shibd_sock.pp
243219
244-
Congrats! You've made the creator of https://stopdisablingselinux.com proud. :)
220+
# Allow httpd to read /var/cache/shibboleth
221+
sudo /usr/sbin/semanage fcontext -a -t httpd_sys_content_t "/var/cache/shibboleth(/.*)?"
222+
sudo /usr/sbin/restorecon -vR /var/cache/shibboleth
245223
246224
Restart Apache and Shibboleth
247225
-----------------------------

0 commit comments

Comments
 (0)