2016-09-01 14:05:35 +00:00
|
|
|
From 3c106c400b9946405289fc5f6b57a76d08667b50 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Alexander Bokovoy <abokovoy@redhat.com>
|
|
|
|
Date: Thu, 1 Sep 2016 17:04:06 +0300
|
2016-03-24 15:43:12 +00:00
|
|
|
Subject: [PATCH] Workarounds for SELinux execmem violations in cryptography
|
2015-12-07 18:03:41 +00:00
|
|
|
|
2015-12-14 23:05:41 +00:00
|
|
|
pki.client no longer tries to use PyOpenSSL instead of Python's ssl
|
|
|
|
module.
|
|
|
|
|
2015-12-07 18:03:41 +00:00
|
|
|
Some dependencies like Dogtag's pki.client library and custodia use
|
|
|
|
python-requsts to make HTTPS connection. python-requests prefers
|
|
|
|
PyOpenSSL over Python's stdlib ssl module. PyOpenSSL is build on top
|
|
|
|
of python-cryptography which trigger a execmem SELinux violation
|
|
|
|
in the context of Apache HTTPD (httpd_execmem).
|
2016-09-01 14:05:35 +00:00
|
|
|
|
2015-12-07 18:03:41 +00:00
|
|
|
When requests is imported, it always tries to import pyopenssl glue
|
|
|
|
code from urllib3's contrib directory. The import of PyOpenSSL is
|
|
|
|
enough to trigger the SELinux denial.
|
2016-09-01 14:05:35 +00:00
|
|
|
|
2015-12-07 18:03:41 +00:00
|
|
|
A hack in wsgi.py prevents the import by raising an ImportError.
|
|
|
|
---
|
|
|
|
install/share/wsgi.py | 14 ++++++++++++++
|
2016-09-01 14:05:35 +00:00
|
|
|
1 file changed, 14 insertions(+)
|
2015-12-07 18:03:41 +00:00
|
|
|
|
|
|
|
diff --git a/install/share/wsgi.py b/install/share/wsgi.py
|
2016-09-01 14:05:35 +00:00
|
|
|
index ee9311e..bb201fa 100644
|
2015-12-07 18:03:41 +00:00
|
|
|
--- a/install/share/wsgi.py
|
|
|
|
+++ b/install/share/wsgi.py
|
|
|
|
@@ -23,6 +23,20 @@
|
|
|
|
"""
|
|
|
|
WSGI appliction for IPA server.
|
|
|
|
"""
|
|
|
|
+import sys
|
|
|
|
+
|
|
|
|
+# Some dependencies like Dogtag's pki.client library and custodia use
|
|
|
|
+# python-requsts to make HTTPS connection. python-requests prefers
|
|
|
|
+# PyOpenSSL over Python's stdlib ssl module. PyOpenSSL is build on top
|
|
|
|
+# of python-cryptography which trigger a execmem SELinux violation
|
|
|
|
+# in the context of Apache HTTPD (httpd_execmem).
|
|
|
|
+# When requests is imported, it always tries to import pyopenssl glue
|
|
|
|
+# code from urllib3's contrib directory. The import of PyOpenSSL is
|
|
|
|
+# enough to trigger the SELinux denial.
|
|
|
|
+# This hack prevents the import by raising an ImportError.
|
|
|
|
+
|
2016-07-22 13:38:21 +00:00
|
|
|
+sys.modules['requests.packages.urllib3.contrib.pyopenssl'] = None
|
2015-12-07 18:03:41 +00:00
|
|
|
+
|
|
|
|
from ipalib import api
|
|
|
|
from ipalib.config import Env
|
|
|
|
from ipalib.constants import DEFAULT_CONFIG
|
|
|
|
--
|
2016-09-01 14:05:35 +00:00
|
|
|
2.7.4
|
2015-12-07 18:03:41 +00:00
|
|
|
|