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

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