2017-04-20 01:06:09

by guido

[permalink] [raw]
Subject: [refpolicy] [PATCH 22/34] postfix: curb on userdom permissions

This patch curbs on userdomain file read and/or write permissions
for the postfix module.

It aims to ensure user data confidentiality.

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

Signed-off-by: Guido Trentalancia <[email protected]>
---
policy/modules/contrib/postfix.te | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)

--- refpolicy-2.20170204-orig/policy/modules/contrib/postfix.te 2016-03-25 14:51:37.000000000 +0100
+++ refpolicy-2.20170204/policy/modules/contrib/postfix.te 2017-04-19 20:17:59.127244704 +0200
@@ -7,6 +7,15 @@ policy_module(postfix, 1.17.0)

## <desc>
## <p>
+## Determine whether postfix can
+## manage the user home directories
+## and files.
+## </p>
+## </desc>
+gen_tunable(postfix_enable_home_dirs, false)
+
+## <desc>
+## <p>
## Determine whether postfix local
## can manage mail spool content.
## </p>
@@ -798,8 +807,8 @@ mta_delete_spool(postfix_virtual_t)
mta_read_config(postfix_virtual_t)
mta_manage_spool(postfix_virtual_t)

-userdom_manage_user_home_dirs(postfix_virtual_t)
-userdom_manage_user_home_content_dirs(postfix_virtual_t)
-userdom_manage_user_home_content_files(postfix_virtual_t)
-userdom_home_filetrans_user_home_dir(postfix_virtual_t)
-userdom_user_home_dir_filetrans_user_home_content(postfix_virtual_t, { file dir })
+tunable_policy(`postfix_enable_home_dirs',`
+ userdom_manage_user_home_content_dirs(postfix_virtual_t)
+ userdom_manage_user_home_content_files(postfix_virtual_t)
+ userdom_user_home_dir_filetrans_user_home_content(postfix_virtual_t, { dir file })
+')