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

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