2010-09-15 14:42:34 +00:00
|
|
|
policy_module(zebra, 1.11.1)
|
2005-09-09 13:24:11 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2007-03-26 18:41:45 +00:00
|
|
|
## <desc>
|
2010-09-24 08:54:04 +00:00
|
|
|
## <p>
|
|
|
|
## Allow zebra daemon to write it configuration files
|
|
|
|
## </p>
|
2007-03-26 18:41:45 +00:00
|
|
|
## </desc>
|
2008-02-05 17:41:53 +00:00
|
|
|
gen_tunable(allow_zebra_write_config, false)
|
2007-03-26 18:41:45 +00:00
|
|
|
|
2005-09-09 13:24:11 +00:00
|
|
|
type zebra_t;
|
|
|
|
type zebra_exec_t;
|
2008-02-05 17:41:53 +00:00
|
|
|
init_daemon_domain(zebra_t, zebra_exec_t)
|
2005-09-09 13:24:11 +00:00
|
|
|
|
|
|
|
type zebra_conf_t;
|
|
|
|
files_type(zebra_conf_t)
|
|
|
|
|
2008-10-08 15:50:03 +00:00
|
|
|
type zebra_initrc_exec_t;
|
|
|
|
init_script_file(zebra_initrc_exec_t)
|
|
|
|
|
2005-09-09 13:24:11 +00:00
|
|
|
type zebra_log_t;
|
|
|
|
logging_log_file(zebra_log_t)
|
|
|
|
|
|
|
|
type zebra_tmp_t;
|
|
|
|
files_tmp_file(zebra_tmp_t)
|
|
|
|
|
|
|
|
type zebra_var_run_t;
|
|
|
|
files_pid_file(zebra_var_run_t)
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
2006-05-30 19:46:34 +00:00
|
|
|
allow zebra_t self:capability { setgid setuid net_admin net_raw };
|
2005-09-09 13:24:11 +00:00
|
|
|
dontaudit zebra_t self:capability sys_tty_config;
|
2008-10-08 15:50:03 +00:00
|
|
|
allow zebra_t self:process { signal_perms getcap setcap };
|
2008-10-16 16:09:20 +00:00
|
|
|
allow zebra_t self:file rw_file_perms;
|
2005-09-09 13:24:11 +00:00
|
|
|
allow zebra_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow zebra_t self:unix_stream_socket { connectto create_stream_socket_perms };
|
2005-11-25 19:09:08 +00:00
|
|
|
allow zebra_t self:netlink_route_socket rw_netlink_socket_perms;
|
2006-02-13 22:05:08 +00:00
|
|
|
allow zebra_t self:tcp_socket { connect connected_stream_socket_perms };
|
2005-10-27 14:08:53 +00:00
|
|
|
allow zebra_t self:udp_socket create_socket_perms;
|
2005-09-09 13:24:11 +00:00
|
|
|
allow zebra_t self:rawip_socket create_socket_perms;
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow zebra_t zebra_conf_t:dir list_dir_perms;
|
2008-07-23 21:38:39 +00:00
|
|
|
read_files_pattern(zebra_t, zebra_conf_t, zebra_conf_t)
|
2008-02-05 17:41:53 +00:00
|
|
|
read_lnk_files_pattern(zebra_t, zebra_conf_t, zebra_conf_t)
|
2005-09-09 13:24:11 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow zebra_t zebra_log_t:dir setattr;
|
2008-02-05 17:41:53 +00:00
|
|
|
manage_files_pattern(zebra_t, zebra_log_t, zebra_log_t)
|
|
|
|
manage_sock_files_pattern(zebra_t, zebra_log_t, zebra_log_t)
|
|
|
|
logging_log_filetrans(zebra_t, zebra_log_t, { sock_file file dir })
|
2005-09-09 13:24:11 +00:00
|
|
|
|
|
|
|
# /tmp/.bgpd is such a bad idea!
|
2006-12-12 20:08:08 +00:00
|
|
|
allow zebra_t zebra_tmp_t:sock_file manage_sock_file_perms;
|
2008-07-23 21:38:39 +00:00
|
|
|
files_tmp_filetrans(zebra_t, zebra_tmp_t, sock_file)
|
2005-09-09 13:24:11 +00:00
|
|
|
|
2010-09-02 20:10:27 +00:00
|
|
|
manage_dirs_pattern(zebra_t, zebra_var_run_t, zebra_var_run_t)
|
2008-02-05 17:41:53 +00:00
|
|
|
manage_files_pattern(zebra_t, zebra_var_run_t, zebra_var_run_t)
|
|
|
|
manage_sock_files_pattern(zebra_t, zebra_var_run_t, zebra_var_run_t)
|
2010-09-02 20:10:27 +00:00
|
|
|
files_pid_filetrans(zebra_t, zebra_var_run_t, { dir file sock_file })
|
2005-09-09 13:24:11 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(zebra_t)
|
2008-10-08 15:50:03 +00:00
|
|
|
kernel_read_network_state(zebra_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(zebra_t)
|
|
|
|
kernel_rw_net_sysctls(zebra_t)
|
2005-09-09 13:24:11 +00:00
|
|
|
|
2007-06-27 15:23:21 +00:00
|
|
|
corenet_all_recvfrom_unlabeled(zebra_t)
|
|
|
|
corenet_all_recvfrom_netlabel(zebra_t)
|
2009-01-06 20:24:10 +00:00
|
|
|
corenet_tcp_sendrecv_generic_if(zebra_t)
|
|
|
|
corenet_udp_sendrecv_generic_if(zebra_t)
|
|
|
|
corenet_raw_sendrecv_generic_if(zebra_t)
|
2009-01-09 19:48:02 +00:00
|
|
|
corenet_tcp_sendrecv_generic_node(zebra_t)
|
|
|
|
corenet_udp_sendrecv_generic_node(zebra_t)
|
|
|
|
corenet_raw_sendrecv_generic_node(zebra_t)
|
2005-09-09 13:24:11 +00:00
|
|
|
corenet_tcp_sendrecv_all_ports(zebra_t)
|
2005-09-28 18:10:48 +00:00
|
|
|
corenet_udp_sendrecv_all_ports(zebra_t)
|
2009-01-09 19:48:02 +00:00
|
|
|
corenet_tcp_bind_generic_node(zebra_t)
|
|
|
|
corenet_udp_bind_generic_node(zebra_t)
|
2006-07-28 15:13:58 +00:00
|
|
|
corenet_tcp_bind_bgp_port(zebra_t)
|
2005-09-09 13:24:11 +00:00
|
|
|
corenet_tcp_bind_zebra_port(zebra_t)
|
2006-02-20 16:31:54 +00:00
|
|
|
corenet_udp_bind_router_port(zebra_t)
|
2006-07-28 15:13:58 +00:00
|
|
|
corenet_tcp_connect_bgp_port(zebra_t)
|
2006-06-02 15:06:45 +00:00
|
|
|
corenet_sendrecv_zebra_server_packets(zebra_t)
|
|
|
|
corenet_sendrecv_router_server_packets(zebra_t)
|
2005-09-09 13:24:11 +00:00
|
|
|
|
2005-10-25 02:51:07 +00:00
|
|
|
dev_associate_usbfs(zebra_var_run_t)
|
|
|
|
dev_list_all_dev_nodes(zebra_t)
|
2005-09-09 13:24:11 +00:00
|
|
|
dev_read_sysfs(zebra_t)
|
2006-01-31 16:08:56 +00:00
|
|
|
dev_rw_zero(zebra_t)
|
2005-09-09 13:24:11 +00:00
|
|
|
|
|
|
|
fs_getattr_all_fs(zebra_t)
|
|
|
|
fs_search_auto_mountpoints(zebra_t)
|
|
|
|
|
2005-10-25 02:51:07 +00:00
|
|
|
term_list_ptys(zebra_t)
|
2005-09-09 13:24:11 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(zebra_t)
|
2005-09-09 13:24:11 +00:00
|
|
|
|
2005-10-25 02:51:07 +00:00
|
|
|
files_search_etc(zebra_t)
|
2005-09-09 13:24:11 +00:00
|
|
|
files_read_etc_files(zebra_t)
|
|
|
|
files_read_etc_runtime_files(zebra_t)
|
|
|
|
|
|
|
|
logging_send_syslog_msg(zebra_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(zebra_t)
|
|
|
|
|
|
|
|
sysnet_read_config(zebra_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_dontaudit_use_unpriv_user_fds(zebra_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_dontaudit_search_user_home_dirs(zebra_t)
|
2005-09-09 13:24:11 +00:00
|
|
|
|
2006-07-28 15:13:58 +00:00
|
|
|
tunable_policy(`allow_zebra_write_config',`
|
2008-02-05 17:41:53 +00:00
|
|
|
manage_files_pattern(zebra_t, zebra_conf_t, zebra_conf_t)
|
2006-07-28 15:13:58 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-09-09 13:24:11 +00:00
|
|
|
nis_use_ypbind(zebra_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-02-02 21:08:12 +00:00
|
|
|
rpm_read_pipes(zebra_t)
|
2005-10-25 02:51:07 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-09-09 13:24:11 +00:00
|
|
|
seutil_sigchld_newrole(zebra_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-09-09 13:24:11 +00:00
|
|
|
udev_read_db(zebra_t)
|
|
|
|
')
|
2007-10-02 16:04:50 +00:00
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
unconfined_sigchld(zebra_t)
|
|
|
|
')
|