aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominick Grift <dominick.grift@gmail.com>2012-10-16 10:46:01 +0200
committerSven Vermeulen <sven.vermeulen@siphos.be>2012-10-16 19:36:07 +0200
commit9ae0c625243f734d380f442011ed5da7159a911e (patch)
tree00d808a9407cb4cbb43e7d1b407ff368cca13759 /policy/modules/contrib/nsd.te
parentTab clean up in the nsd file context file (diff)
downloadhardened-refpolicy-9ae0c625243f734d380f442011ed5da7159a911e.tar.gz
hardened-refpolicy-9ae0c625243f734d380f442011ed5da7159a911e.tar.bz2
hardened-refpolicy-9ae0c625243f734d380f442011ed5da7159a911e.zip
Changes to the nsd policy module
Ported from Fedora with changes Signed-off-by: Dominick Grift <dominick.grift@gmail.com>
Diffstat (limited to 'policy/modules/contrib/nsd.te')
-rw-r--r--policy/modules/contrib/nsd.te77
1 files changed, 29 insertions, 48 deletions
diff --git a/policy/modules/contrib/nsd.te b/policy/modules/contrib/nsd.te
index 4b15536ca..dde7f42e2 100644
--- a/policy/modules/contrib/nsd.te
+++ b/policy/modules/contrib/nsd.te
@@ -1,4 +1,4 @@
-policy_module(nsd, 1.7.0)
+policy_module(nsd, 1.7.1)
########################################
#
@@ -9,7 +9,9 @@ type nsd_t;
type nsd_exec_t;
init_daemon_domain(nsd_t, nsd_exec_t)
-# A type for configuration files of nsd
+type nsd_initrc_exec_t;
+init_script_file(nsd_initrc_exec_t)
+
type nsd_conf_t;
files_type(nsd_conf_t)
@@ -18,31 +20,29 @@ domain_type(nsd_crond_t)
domain_entry_file(nsd_crond_t, nsd_exec_t)
role system_r types nsd_crond_t;
-# a type for nsd.db
type nsd_db_t;
files_type(nsd_db_t)
type nsd_var_run_t;
files_pid_file(nsd_var_run_t)
-# A type for zone files
type nsd_zone_t;
files_type(nsd_zone_t)
########################################
#
-# NSD Local policy
+# Local policy
#
-allow nsd_t self:capability { dac_override chown setuid setgid };
+allow nsd_t self:capability { chown dac_override kill setgid setuid };
dontaudit nsd_t self:capability sys_tty_config;
allow nsd_t self:process signal_perms;
-allow nsd_t self:tcp_socket create_stream_socket_perms;
-allow nsd_t self:udp_socket create_socket_perms;
+allow nsd_t self:fifo_file rw_fifo_file_perms;
+allow nsd_t self:tcp_socket { accept listen };
allow nsd_t nsd_conf_t:dir list_dir_perms;
-read_files_pattern(nsd_t, nsd_conf_t, nsd_conf_t)
-read_lnk_files_pattern(nsd_t, nsd_conf_t, nsd_conf_t)
+allow nsd_t nsd_conf_t:file read_file_perms;
+allow nsd_t nsd_conf_t:lnk_file read_lnk_file_perms;
allow nsd_t nsd_db_t:file manage_file_perms;
filetrans_pattern(nsd_t, nsd_zone_t, nsd_db_t, file)
@@ -50,9 +50,10 @@ filetrans_pattern(nsd_t, nsd_zone_t, nsd_db_t, file)
manage_files_pattern(nsd_t, nsd_var_run_t, nsd_var_run_t)
files_pid_filetrans(nsd_t, nsd_var_run_t, file)
-allow nsd_t nsd_zone_t:dir list_dir_perms;
-read_files_pattern(nsd_t, nsd_zone_t, nsd_zone_t)
-read_lnk_files_pattern(nsd_t, nsd_zone_t, nsd_zone_t)
+manage_dirs_pattern(nsd_t, nsd_zone_t, nsd_zone_t)
+manage_files_pattern(nsd_t, nsd_zone_t, nsd_zone_t)
+manage_lnk_files_pattern(nsd_t, nsd_zone_t, nsd_zone_t)
+files_var_lib_filetrans(nsd_t, nsd_zone_t, dir)
can_exec(nsd_t, nsd_exec_t)
@@ -71,34 +72,30 @@ corenet_tcp_sendrecv_all_ports(nsd_t)
corenet_udp_sendrecv_all_ports(nsd_t)
corenet_tcp_bind_generic_node(nsd_t)
corenet_udp_bind_generic_node(nsd_t)
+
+corenet_sendrecv_dns_server_packets(nsd_t)
corenet_tcp_bind_dns_port(nsd_t)
corenet_udp_bind_dns_port(nsd_t)
-corenet_sendrecv_dns_server_packets(nsd_t)
dev_read_sysfs(nsd_t)
domain_use_interactive_fds(nsd_t)
-files_read_etc_files(nsd_t)
files_read_etc_runtime_files(nsd_t)
fs_getattr_all_fs(nsd_t)
fs_search_auto_mountpoints(nsd_t)
+auth_use_nsswitch(nsd_t)
+
logging_send_syslog_msg(nsd_t)
miscfiles_read_localization(nsd_t)
-sysnet_read_config(nsd_t)
-
userdom_dontaudit_use_unpriv_user_fds(nsd_t)
userdom_dontaudit_search_user_home_dirs(nsd_t)
optional_policy(`
- nis_use_ypbind(nsd_t)
-')
-
-optional_policy(`
seutil_sigchld_newrole(nsd_t)
')
@@ -108,26 +105,23 @@ optional_policy(`
########################################
#
-# Zone update cron job local policy
+# Cron local policy
#
-# kill capability for root cron job and non-root daemon
allow nsd_crond_t self:capability { dac_override kill };
dontaudit nsd_crond_t self:capability sys_nice;
allow nsd_crond_t self:process { setsched signal_perms };
allow nsd_crond_t self:fifo_file rw_fifo_file_perms;
-allow nsd_crond_t self:tcp_socket create_socket_perms;
-allow nsd_crond_t self:udp_socket create_socket_perms;
+allow nsd_crond_t nsd_t:process signal;
+ps_process_pattern(nsd_crond_t, nsd_t)
+
+allow nsd_crond_t nsd_conf_t:dir list_dir_perms;
allow nsd_crond_t nsd_conf_t:file read_file_perms;
+allow nsd_crond_t nsd_conf_t:lnk_file read_lnk_file_perms;
allow nsd_crond_t nsd_db_t:file manage_file_perms;
filetrans_pattern(nsd_crond_t, nsd_zone_t, nsd_db_t, file)
-files_search_var_lib(nsd_crond_t)
-
-allow nsd_crond_t nsd_t:process signal;
-
-ps_process_pattern(nsd_crond_t, nsd_t)
manage_files_pattern(nsd_crond_t, nsd_zone_t, nsd_zone_t)
filetrans_pattern(nsd_crond_t, nsd_conf_t, nsd_zone_t, file)
@@ -142,39 +136,26 @@ corecmd_exec_shell(nsd_crond_t)
corenet_all_recvfrom_unlabeled(nsd_crond_t)
corenet_all_recvfrom_netlabel(nsd_crond_t)
corenet_tcp_sendrecv_generic_if(nsd_crond_t)
-corenet_udp_sendrecv_generic_if(nsd_crond_t)
corenet_tcp_sendrecv_generic_node(nsd_crond_t)
-corenet_udp_sendrecv_generic_node(nsd_crond_t)
-corenet_tcp_sendrecv_all_ports(nsd_crond_t)
-corenet_udp_sendrecv_all_ports(nsd_crond_t)
-corenet_tcp_connect_all_ports(nsd_crond_t)
+
corenet_sendrecv_all_client_packets(nsd_crond_t)
+corenet_tcp_connect_all_ports(nsd_crond_t)
+corenet_tcp_sendrecv_all_ports(nsd_crond_t)
-# for SSP
dev_read_urand(nsd_crond_t)
domain_dontaudit_read_all_domains_state(nsd_crond_t)
-files_read_etc_files(nsd_crond_t)
files_read_etc_runtime_files(nsd_crond_t)
-files_search_var_lib(nsd_t)
+
+auth_use_nsswitch(nsd_crond_t)
logging_send_syslog_msg(nsd_crond_t)
miscfiles_read_localization(nsd_crond_t)
-sysnet_read_config(nsd_crond_t)
-
userdom_dontaudit_search_user_home_dirs(nsd_crond_t)
optional_policy(`
cron_system_entry(nsd_crond_t, nsd_exec_t)
')
-
-optional_policy(`
- nis_use_ypbind(nsd_crond_t)
-')
-
-optional_policy(`
- nscd_read_pid(nsd_crond_t)
-')