Chris PeBenito 29af4c
policy_module(zebra, 1.11.0)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 56e1b3
## <desc>
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## Allow zebra daemon to write it configuration files
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## </desc>
Chris PeBenito 56e1b3
#
Chris PeBenito ce8a52
gen_tunable(allow_zebra_write_config, false)
Chris PeBenito 56e1b3
Chris PeBenito 17de1b
type zebra_t;
Chris PeBenito 17de1b
type zebra_exec_t;
Chris PeBenito ce8a52
init_daemon_domain(zebra_t, zebra_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type zebra_conf_t;
Chris PeBenito 17de1b
files_type(zebra_conf_t)
Chris PeBenito 17de1b
Chris PeBenito e87221
type zebra_initrc_exec_t;
Chris PeBenito e87221
init_script_file(zebra_initrc_exec_t)
Chris PeBenito e87221
Chris PeBenito 17de1b
type zebra_log_t;
Chris PeBenito 17de1b
logging_log_file(zebra_log_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type zebra_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(zebra_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type zebra_var_run_t;
Chris PeBenito 17de1b
files_pid_file(zebra_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow zebra_t self:capability { setgid setuid net_admin net_raw };
Chris PeBenito 17de1b
dontaudit zebra_t self:capability sys_tty_config;
Chris PeBenito e87221
allow zebra_t self:process { signal_perms getcap setcap };
Chris PeBenito 0b36a2
allow zebra_t self:file rw_file_perms;
Chris PeBenito 17de1b
allow zebra_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow zebra_t self:unix_stream_socket { connectto create_stream_socket_perms };
Chris PeBenito 17de1b
allow zebra_t self:netlink_route_socket rw_netlink_socket_perms;
Chris PeBenito 17de1b
allow zebra_t self:tcp_socket { connect connected_stream_socket_perms };
Chris PeBenito 17de1b
allow zebra_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
allow zebra_t self:rawip_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow zebra_t zebra_conf_t:dir list_dir_perms;
Chris PeBenito 0bfccd
read_files_pattern(zebra_t, zebra_conf_t, zebra_conf_t)
Chris PeBenito ce8a52
read_lnk_files_pattern(zebra_t, zebra_conf_t, zebra_conf_t)
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow zebra_t zebra_log_t:dir setattr;
Chris PeBenito ce8a52
manage_files_pattern(zebra_t, zebra_log_t, zebra_log_t)
Chris PeBenito ce8a52
manage_sock_files_pattern(zebra_t, zebra_log_t, zebra_log_t)
Chris PeBenito ce8a52
logging_log_filetrans(zebra_t, zebra_log_t, { sock_file file dir })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# /tmp/.bgpd is such a bad idea!
Chris PeBenito c0868a
allow zebra_t zebra_tmp_t:sock_file manage_sock_file_perms;
Chris PeBenito 0bfccd
files_tmp_filetrans(zebra_t, zebra_tmp_t, sock_file)
Chris PeBenito 17de1b
Jeremy Solt bf4079
manage_dirs_pattern(zebra_t, zebra_var_run_t, zebra_var_run_t)
Chris PeBenito ce8a52
manage_files_pattern(zebra_t, zebra_var_run_t, zebra_var_run_t)
Chris PeBenito ce8a52
manage_sock_files_pattern(zebra_t, zebra_var_run_t, zebra_var_run_t)
Jeremy Solt bf4079
files_pid_filetrans(zebra_t, zebra_var_run_t, { dir file sock_file })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_system_state(zebra_t)
Chris PeBenito e87221
kernel_read_network_state(zebra_t)
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(zebra_t)
Chris PeBenito 17de1b
kernel_rw_net_sysctls(zebra_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(zebra_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(zebra_t)
Chris PeBenito 668b30
corenet_tcp_sendrecv_generic_if(zebra_t)
Chris PeBenito 668b30
corenet_udp_sendrecv_generic_if(zebra_t)
Chris PeBenito 668b30
corenet_raw_sendrecv_generic_if(zebra_t)
Chris PeBenito c12621
corenet_tcp_sendrecv_generic_node(zebra_t)
Chris PeBenito c12621
corenet_udp_sendrecv_generic_node(zebra_t)
Chris PeBenito c12621
corenet_raw_sendrecv_generic_node(zebra_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(zebra_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(zebra_t)
Chris PeBenito c12621
corenet_tcp_bind_generic_node(zebra_t)
Chris PeBenito c12621
corenet_udp_bind_generic_node(zebra_t)
Chris PeBenito 465510
corenet_tcp_bind_bgp_port(zebra_t)
Chris PeBenito 17de1b
corenet_tcp_bind_zebra_port(zebra_t)
Chris PeBenito 17de1b
corenet_udp_bind_router_port(zebra_t)
Chris PeBenito 465510
corenet_tcp_connect_bgp_port(zebra_t)
Chris PeBenito 17de1b
corenet_sendrecv_zebra_server_packets(zebra_t)
Chris PeBenito 17de1b
corenet_sendrecv_router_server_packets(zebra_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_associate_usbfs(zebra_var_run_t)
Chris PeBenito 17de1b
dev_list_all_dev_nodes(zebra_t)
Chris PeBenito 17de1b
dev_read_sysfs(zebra_t)
Chris PeBenito 17de1b
dev_rw_zero(zebra_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_all_fs(zebra_t)
Chris PeBenito 17de1b
fs_search_auto_mountpoints(zebra_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_list_ptys(zebra_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(zebra_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_search_etc(zebra_t)
Chris PeBenito 17de1b
files_read_etc_files(zebra_t)
Chris PeBenito 17de1b
files_read_etc_runtime_files(zebra_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(zebra_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(zebra_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(zebra_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(zebra_t)
Chris PeBenito 296273
userdom_dontaudit_search_user_home_dirs(zebra_t)
Chris PeBenito 17de1b
Chris PeBenito 465510
tunable_policy(`allow_zebra_write_config',`
Chris PeBenito ce8a52
	manage_files_pattern(zebra_t, zebra_conf_t, zebra_conf_t)
Chris PeBenito 465510
')
Chris PeBenito 465510
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nis_use_ypbind(zebra_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	rpm_read_pipes(zebra_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(zebra_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(zebra_t)
Chris PeBenito 17de1b
')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
optional_policy(`
Chris PeBenito 350b6a
	unconfined_sigchld(zebra_t)
Chris PeBenito 350b6a
')