86baa9
From dfb0b27748aebb307fa3ab72aa1c43a71da1d78e Mon Sep 17 00:00:00 2001
86baa9
From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= <fcami@redhat.com>
86baa9
Date: Fri, 9 Nov 2018 17:30:32 +0100
86baa9
Subject: [PATCH] Add sysadm_r to default SELinux user map order
86baa9
MIME-Version: 1.0
86baa9
Content-Type: text/plain; charset=UTF-8
86baa9
Content-Transfer-Encoding: 8bit
86baa9
86baa9
It is a standard SELinux user role included in RHEL (like
86baa9
user_r, staff_r, guest_r) and used quite often.
86baa9
86baa9
Fixes: https://pagure.io/freeipa/issue/7658
86baa9
Signed-off-by: François Cami <fcami@redhat.com>
86baa9
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
86baa9
Reviewed-By: Christian Heimes <cheimes@redhat.com>
86baa9
---
86baa9
 install/share/bootstrap-template.ldif      | 2 +-
86baa9
 install/ui/test/data/ipa_init.json         | 2 +-
86baa9
 ipatests/test_xmlrpc/test_config_plugin.py | 8 ++++++--
86baa9
 3 files changed, 8 insertions(+), 4 deletions(-)
86baa9
86baa9
diff --git a/install/share/bootstrap-template.ldif b/install/share/bootstrap-template.ldif
86baa9
index 1b80794e66a5986d049195885ae1c9d6380eec81..6cd17e37ef147169b65709a56b0fa7312889c262 100644
86baa9
--- a/install/share/bootstrap-template.ldif
86baa9
+++ b/install/share/bootstrap-template.ldif
86baa9
@@ -425,7 +425,7 @@ ipaDefaultEmailDomain: $DOMAIN
86baa9
 ipaMigrationEnabled: FALSE
86baa9
 ipaConfigString: AllowNThash
86baa9
 ipaConfigString: KDC:Disable Last Success
86baa9
-ipaSELinuxUserMapOrder: guest_u:s0$$xguest_u:s0$$user_u:s0$$staff_u:s0-s0:c0.c1023$$unconfined_u:s0-s0:c0.c1023
86baa9
+ipaSELinuxUserMapOrder: guest_u:s0$$xguest_u:s0$$user_u:s0$$staff_u:s0-s0:c0.c1023$$sysadm_u:s0-s0:c0.c1023$$unconfined_u:s0-s0:c0.c1023
86baa9
 ipaSELinuxUserMapDefault: unconfined_u:s0-s0:c0.c1023
86baa9
 
86baa9
 dn: cn=cosTemplates,cn=accounts,$SUFFIX
86baa9
diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json
86baa9
index dd4b84cc920408ec8fa0bb92e9d6debc67cede7e..52f6ab191e05b314fcbeaa4786230e5ae2ebea4b 100644
86baa9
--- a/install/ui/test/data/ipa_init.json
86baa9
+++ b/install/ui/test/data/ipa_init.json
86baa9
@@ -863,7 +863,7 @@
86baa9
                   "ipausers"
86baa9
                ],
86baa9
                "ipaselinuxusermaporder" : [
86baa9
-                  "guest_u:s0$xguest_u:s0$user_u:s0$staff_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023"
86baa9
+                  "guest_u:s0$xguest_u:s0$user_u:s0$staff_u:s0-s0:c0.c1023$sysadm_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023"
86baa9
                ],
86baa9
                "ca_renewal_master_server" : [
86baa9
                   "vm.example.com"
86baa9
diff --git a/ipatests/test_xmlrpc/test_config_plugin.py b/ipatests/test_xmlrpc/test_config_plugin.py
86baa9
index a277eab7eeb44590f982510564e92935c444c744..bd5a62acbed6a6c29bbf5fcbd041ef59bb0363bd 100644
86baa9
--- a/ipatests/test_xmlrpc/test_config_plugin.py
86baa9
+++ b/ipatests/test_xmlrpc/test_config_plugin.py
86baa9
@@ -148,8 +148,12 @@ class test_config(Declarative):
86baa9
 
86baa9
         dict(
86baa9
             desc='Try to set new selinux order and invalid default user',
86baa9
-            command=('config_mod', [],
86baa9
-                dict(ipaselinuxusermaporder=u'xguest_u:s0$guest_u:s0$user_u:s0-s0:c0.c1023$staff_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023',
86baa9
+            command=(
86baa9
+                'config_mod', [],
86baa9
+                dict(
86baa9
+                    ipaselinuxusermaporder=u'xguest_u:s0$guest_u:s0'
86baa9
+                    u'$user_u:s0-s0:c0.c1023$staff_u:s0-s0:c0.c1023'
86baa9
+                    u'$sysadm_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023',
86baa9
                     ipaselinuxusermapdefault=u'unknown_u:s0')),
86baa9
             expected=errors.ValidationError(name='ipaselinuxusermapdefault',
86baa9
                 error='SELinux user map default user not in order list'),
86baa9
-- 
86baa9
2.20.1
86baa9