Blame SOURCES/0011-Fix-AVC-denial-during-ipa-adtrust-install---add-agents_rhbz#1859213.patch

91acb2
From c72ef1ed965aca79da4576d9579dec5459e14b99 Mon Sep 17 00:00:00 2001
91acb2
From: Christian Heimes <cheimes@redhat.com>
91acb2
Date: Fri, 8 May 2020 15:27:01 +0200
91acb2
Subject: [PATCH] SELinux: Backport dirsrv_systemctl interface
91acb2
91acb2
Signed-off-by: Christian Heimes <cheimes@redhat.com>
91acb2
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
91acb2
Reviewed-By: Christian Heimes <cheimes@redhat.com>
91acb2
---
91acb2
 selinux/ipa.if | 27 +++++++++++++++++++++++++++
91acb2
 1 file changed, 27 insertions(+)
91acb2
91acb2
diff --git a/selinux/ipa.if b/selinux/ipa.if
91acb2
index cefae5d90..ea971b8fa 100644
91acb2
--- a/selinux/ipa.if
91acb2
+++ b/selinux/ipa.if
91acb2
@@ -392,3 +392,30 @@ ifndef(`apache_manage_pid_files',`
91acb2
 		manage_sock_files_pattern($1, httpd_var_run_t, httpd_var_run_t)
91acb2
 	')
91acb2
 ')
91acb2
+
91acb2
+########################################
91acb2
+## <summary>
91acb2
+##	Execute dirsrv server in the dirsrv domain.
91acb2
+##  Backport from https://github.com/fedora-selinux/selinux-policy-contrib/pull/241
91acb2
+## </summary>
91acb2
+## <param name="domain">
91acb2
+##	<summary>
91acb2
+##	Domain allowed to transition.
91acb2
+##	</summary>
91acb2
+## </param>
91acb2
+#
91acb2
+ifndef(`dirsrv_systemctl',`
91acb2
+    interface(`dirsrv_systemctl',`
91acb2
+        gen_require(`
91acb2
+            type dirsrv_unit_file_t;
91acb2
+            type dirsrv_t;
91acb2
+        ')
91acb2
+
91acb2
+        systemd_exec_systemctl($1)
91acb2
+        init_reload_services($1)
91acb2
+        allow $1 dirsrv_unit_file_t:file read_file_perms;
91acb2
+        allow $1 dirsrv_unit_file_t:service manage_service_perms;
91acb2
+
91acb2
+        ps_process_pattern($1, dirsrv_t)
91acb2
+    ')
91acb2
+')
91acb2
-- 
91acb2
2.26.2
91acb2
91acb2
From f76c56c6072418c78f138678b1c4dd917fea6ee1 Mon Sep 17 00:00:00 2001
91acb2
From: Zdenek Pytela <zpytela@redhat.com>
91acb2
Date: Thu, 7 May 2020 16:17:12 +0200
91acb2
Subject: [PATCH] Allow ipa-adtrust-install restart sssd and dirsrv services
91acb2
91acb2
Allow ipa_helper_t connect to init using /run/systemd/private socket.
91acb2
Allow ipa_helper_t read init process state.
91acb2
Allow ipa_helper_t manage sssd and dirsrv units.
91acb2
91acb2
See: https://bugzilla.redhat.com/show_bug.cgi?id=1820298
91acb2
See: https://github.com/fedora-selinux/selinux-policy-contrib/pull/241
91acb2
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
91acb2
Reviewed-By: Christian Heimes <cheimes@redhat.com>
91acb2
---
91acb2
 selinux/ipa.te | 8 ++++++++
91acb2
 1 file changed, 8 insertions(+)
91acb2
91acb2
diff --git a/selinux/ipa.te b/selinux/ipa.te
91acb2
index b1e29c8e2..587e5e585 100644
91acb2
--- a/selinux/ipa.te
91acb2
+++ b/selinux/ipa.te
91acb2
@@ -147,6 +147,9 @@ auth_use_nsswitch(ipa_helper_t)
91acb2
 
91acb2
 files_list_tmp(ipa_helper_t)
91acb2
 
91acb2
+init_read_state(ipa_helper_t)
91acb2
+init_stream_connect(ipa_helper_t)
91acb2
+
91acb2
 ipa_manage_pid_files(ipa_helper_t)
91acb2
 ipa_read_lib(ipa_helper_t)
91acb2
 
91acb2
@@ -156,6 +159,10 @@ optional_policy(`
91acb2
     dirsrv_stream_connect(ipa_helper_t)
91acb2
 ')
91acb2
 
91acb2
+optional_policy(`
91acb2
+    dirsrv_systemctl(ipa_helper_t)
91acb2
+')
91acb2
+
91acb2
 optional_policy(`
91acb2
     ldap_stream_connect(ipa_helper_t)
91acb2
 ')
91acb2
@@ -182,6 +189,7 @@ optional_policy(`
91acb2
 
91acb2
 optional_policy(`
91acb2
     sssd_manage_lib_files(ipa_helper_t)
91acb2
+    sssd_systemctl(ipa_helper_t)
91acb2
 ')
91acb2
 
91acb2
 ########################################
91acb2
-- 
91acb2
2.26.2
91acb2