From: guido@trentalancia.net (Guido Trentalancia) Date: Sun, 14 Aug 2016 20:27:55 +0200 Subject: [refpolicy] [PATCH v6] Update the dhcp client part of the sysnetwork module In-Reply-To: <557137276.942733.1471125796170.JavaMail.open-xchange@popper02.register.it> References: <1470694327.13546.1.camel@trentalancia.net> <1470762337.7062.1.camel@trentalancia.net> <1471095487.21480.15.camel@trentalancia.net> <1471095869.21480.17.camel@trentalancia.net> <557137276.942733.1471125796170.JavaMail.open-xchange@popper02.register.it> Message-ID: <1471199275.27146.8.camel@trentalancia.net> To: refpolicy@oss.tresys.com List-Id: refpolicy.oss.tresys.com Update the sysnetwork module to add some permissions needed by the dhcp client (another separate patch makes changes to the ifconfig part). Create auxiliary interfaces in the ntp module. The permission to execute restorecon/setfiles (required by the dhclient-script script and granted in a previous version of this patch) is not granted, as it does not break the script functioning. Include revisions from Chris PeBenito. Signed-off-by: Guido Trentalancia --- policy/modules/contrib/ntp.if | 19 +++++++++++++++++++ policy/modules/system/sysnetwork.te | 10 ++++++++++ 2 files changed, 29 insertions(+) --- refpolicy-git-06082016-orig/policy/modules/contrib/ntp.if 2016-08-06 21:27:11.375094577 +0200 +++ refpolicy-git-06082016/policy/modules/contrib/ntp.if 2016-08-08 23:09:34.553877178 +0200 @@ -101,6 +101,25 @@ interface(`ntp_initrc_domtrans',` ######################################## ## +## Read ntp conf files. +## +## +## +## Domain allowed access. +## +## +# +interface(`ntp_read_conf_files',` + gen_require(` + type ntp_conf_t; + ') + + files_search_etc($1) + read_files_pattern($1, ntp_conf_t, ntp_conf_t) +') + +######################################## +## ## Read ntp drift files. ## ## --- refpolicy-git-06082016-orig/policy/modules/system/sysnetwork.te 2016-08-06 21:26:43.309774442 +0200 +++ refpolicy-git-06082016/policy/modules/system/sysnetwork.te 2016-08-14 20:17:19.170766644 +0200 @@ -77,11 +77,17 @@ files_pid_filetrans(dhcpc_t, dhcpc_var_r sysnet_manage_config(dhcpc_t) files_etc_filetrans(dhcpc_t, net_conf_t, file) +# manage files in /var +files_manage_var_files(dhcpc_t) + # create temp files manage_dirs_pattern(dhcpc_t, dhcpc_tmp_t, dhcpc_tmp_t) manage_files_pattern(dhcpc_t, dhcpc_tmp_t, dhcpc_tmp_t) files_tmp_filetrans(dhcpc_t, dhcpc_tmp_t, { file dir }) +# search cgroup directories +fs_search_cgroup_dirs(dhcpc_t) + can_exec(dhcpc_t, dhcpc_exec_t) kernel_read_system_state(dhcpc_t) @@ -225,6 +231,7 @@ optional_policy(` optional_policy(` ntp_initrc_domtrans(dhcpc_t) ntp_read_drift_files(dhcpc_t) + ntp_read_conf_files(dhcpc_t) ') optional_policy(`