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

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