All of lore.kernel.org
 help / color / mirror / Atom feed
From: guido@trentalancia.net (Guido Trentalancia)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH v2 26/33] selinuxutil: curb on userdom permissions
Date: Thu, 20 Apr 2017 15:54:16 +0200 (CEST)	[thread overview]
Message-ID: <62833731.195668.1492696456494@pim.register.it> (raw)
In-Reply-To: <773759495.164534.1492650521782@pim.register.it>

This patch curbs on userdomain file read and/or write permissions
for the SELinux utilities (selinuxutil) module.

It aims to ensure user data confidentiality.

A boolean has been introduced to revert the previous read/write
behavior.

This second version removes misplaced unrelated bits under testing.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
---
 policy/modules/system/selinuxutil.te |   28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

--- a/policy/modules/system/selinuxutil.te	2017-02-04 19:30:19.000000000 +0100
+++ b/policy/modules/system/selinuxutil.te	2017-04-20 00:27:50.508446073 +0200
@@ -9,6 +9,15 @@ gen_require(`
 # Declarations
 #
 
+## <desc>
+##	<p>
+##	Determine whether the SELinux
+##	utilities can read the user
+##	home directories and files.
+##	</p>
+## </desc>
+gen_tunable(selinuxutil_enable_home_dirs, false)
+
 attribute can_write_binary_policy;
 attribute can_relabelto_binary_policy;
 
@@ -501,8 +518,7 @@ seutil_get_semanage_read_lock(semanage_t
 # netfilter_contexts:
 seutil_manage_default_contexts(semanage_t)
 
-# Handle pp files created in homedir and /tmp
-userdom_read_user_home_content_files(semanage_t)
+# Handle pp files created in /tmp
 userdom_read_user_tmp_files(semanage_t)
 
 ifdef(`distro_debian',`
@@ -516,6 +523,13 @@ ifdef(`distro_ubuntu',`
 	')
 ')
 
+tunable_policy(`selinuxutil_enable_home_dirs',`
+	# Handle pp files created in homedir
+	userdom_read_user_home_content_files(semanage_t)
+',`
+	userdom_dontaudit_read_user_home_content_files(semanage_t)
+')
+
 ########################################
 #
 # Setfiles local policy
@@ -592,8 +624,6 @@ seutil_libselinux_linked(setfiles_t)
 seutil_read_module_store(setfiles_t)
 
 userdom_use_all_users_fds(setfiles_t)
-# for config files in a home directory
-userdom_read_user_home_content_files(setfiles_t)
 
 ifdef(`distro_debian',`
 	# udev tmpfs is populated with static device nodes
@@ -627,6 +657,13 @@ ifdef(`hide_broken_symptoms',`
 	')
 ')
 
+tunable_policy(`selinuxutil_enable_home_dirs',`
+	# for config files in a home directory
+	userdom_read_user_home_content_files(setfiles_t)
+',`
+	userdom_dontaudit_read_user_home_content_files(setfiles_t)
+')
+
 optional_policy(`
 	hotplug_use_fds(setfiles_t)
 ')

      reply	other threads:[~2017-04-20 13:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20  1:08 [refpolicy] [PATCH 26/33] selinuxutil: curb on userdom permissions Guido Trentalancia
2017-04-20 13:54 ` Guido Trentalancia [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=62833731.195668.1492696456494@pim.register.it \
    --to=guido@trentalancia.net \
    --cc=refpolicy@oss.tresys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.