Blame SOURCES/0005-selinux-don-t-audit-rules-deny-fetching-trust-topology_rhbz#1845596.patch

91acb2
From 42dd1628a1211363c860917e474ecc5b9c1fdb84 Mon Sep 17 00:00:00 2001
91acb2
From: Alexander Bokovoy <abokovoy@redhat.com>
91acb2
Date: Thu, 2 Jul 2020 15:50:00 +0300
91acb2
Subject: [PATCH] selinux: allow oddjobd to set up ipa_helper_t context for
91acb2
 execution
91acb2
91acb2
On Fedora 32+ and RHEL 8.3.0+ execution of ipa_helper_t context requires
91acb2
SELinux policy permission to use 'noatsecure'. This comes most likely
91acb2
from execve() setup by glibc.
91acb2
91acb2
Add SELinux interface ipa_helper_noatsecure() that can be called by
91acb2
oddjob's SELinux policy definition.
91acb2
91acb2
In addition, if ipa_helper_t runs ipa-getkeytab, libkrb5 will attempt to
91acb2
access SELinux configuration and produce AVC for that. Allow reading
91acb2
general userspace SELinux configuration.
91acb2
91acb2
Fixes: https://pagure.io/freeipa/issue/8395
91acb2
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
91acb2
Reviewed-By: Christian Heimes <cheimes@redhat.com>
91acb2
---
91acb2
 selinux/ipa.if | 18 ++++++++++++++++++
91acb2
 selinux/ipa.te |  1 +
91acb2
 2 files changed, 19 insertions(+)
91acb2
91acb2
diff --git a/selinux/ipa.if b/selinux/ipa.if
91acb2
index ea971b8fa..783db8b78 100644
91acb2
--- a/selinux/ipa.if
91acb2
+++ b/selinux/ipa.if
91acb2
@@ -419,3 +419,21 @@ ifndef(`dirsrv_systemctl',`
91acb2
         ps_process_pattern($1, dirsrv_t)
91acb2
     ')
91acb2
 ')
91acb2
+
91acb2
+
91acb2
+########################################
91acb2
+## <summary>
91acb2
+##	Allow ipa_helper noatsecure
91acb2
+## </summary>
91acb2
+## <param name="domain">
91acb2
+##	<summary>
91acb2
+##	Domain allowed access.
91acb2
+##	</summary>
91acb2
+## </param>
91acb2
+#
91acb2
+interface(`ipa_helper_noatsecure',`
91acb2
+    gen_require(`
91acb2
+	type ipa_helper_t;
91acb2
+    ')
91acb2
+    allow $1 ipa_helper_t:process { noatsecure };
91acb2
+')
91acb2
diff --git a/selinux/ipa.te b/selinux/ipa.te
91acb2
index 587e5e585..383979094 100644
91acb2
--- a/selinux/ipa.te
91acb2
+++ b/selinux/ipa.te
91acb2
@@ -115,6 +115,7 @@ optional_policy(`
91acb2
 
91acb2
 
91acb2
 allow ipa_helper_t self:capability { net_admin dac_read_search dac_override chown };
91acb2
+seutil_read_config(ipa_helper_t);
91acb2
 
91acb2
 #kernel bug
91acb2
 dontaudit ipa_helper_t self:capability2  block_suspend;
91acb2
-- 
91acb2
2.26.2
91acb2
91acb2
From 0d70addbbf2a99e7398a518bc98d5fe109469bb5 Mon Sep 17 00:00:00 2001
91acb2
From: Alexander Bokovoy <abokovoy@redhat.com>
91acb2
Date: Fri, 3 Jul 2020 17:20:49 +0300
91acb2
Subject: [PATCH] selinux: support running ipa-custodia with PrivateTmp=yes
91acb2
91acb2
Related: https://pagure.io/freeipa/issue/8395
91acb2
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
91acb2
Reviewed-By: Christian Heimes <cheimes@redhat.com>
91acb2
---
91acb2
 selinux/ipa.te | 4 ++++
91acb2
 1 file changed, 4 insertions(+)
91acb2
91acb2
diff --git a/selinux/ipa.te b/selinux/ipa.te
91acb2
index 383979094..a3381217a 100644
91acb2
--- a/selinux/ipa.te
91acb2
+++ b/selinux/ipa.te
91acb2
@@ -390,3 +390,7 @@ optional_policy(`
91acb2
 	sssd_search_lib(ipa_custodia_t)
91acb2
 	sssd_stream_connect(ipa_custodia_t)
91acb2
 ')
91acb2
+
91acb2
+optional_policy(`
91acb2
+       systemd_private_tmp(ipa_custodia_tmp_t)
91acb2
+')
91acb2
-- 
91acb2
2.26.2
91acb2