Chris PeBenito 17de1b
Chris PeBenito a52b4d
policy_module(portmap,1.3.0)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type portmap_t;
Chris PeBenito 17de1b
type portmap_exec_t;
Chris PeBenito 17de1b
init_daemon_domain(portmap_t,portmap_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type portmap_helper_t;
Chris PeBenito 17de1b
type portmap_helper_exec_t;
Chris PeBenito 17de1b
init_system_domain(portmap_helper_t,portmap_helper_exec_t)
Chris PeBenito 17de1b
role system_r types portmap_helper_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type portmap_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(portmap_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type portmap_var_run_t;
Chris PeBenito 17de1b
files_pid_file(portmap_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Portmap local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow portmap_t self:capability { setuid setgid };
Chris PeBenito 17de1b
dontaudit portmap_t self:capability sys_tty_config;
Chris PeBenito 17de1b
allow portmap_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito 17de1b
allow portmap_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow portmap_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow portmap_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow portmap_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
manage_dirs_pattern(portmap_t,portmap_tmp_t,portmap_tmp_t)
Chris PeBenito c0868a
manage_files_pattern(portmap_t,portmap_tmp_t,portmap_tmp_t)
Chris PeBenito 17de1b
files_tmp_filetrans(portmap_t, portmap_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito c0868a
manage_files_pattern(portmap_t,portmap_var_run_t,portmap_var_run_t)
Chris PeBenito 17de1b
files_pid_filetrans(portmap_t,portmap_var_run_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(portmap_t)
Chris PeBenito 17de1b
kernel_list_proc(portmap_t)
Chris PeBenito 17de1b
kernel_read_proc_symlinks(portmap_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corenet_non_ipsec_sendrecv(portmap_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_if(portmap_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_if(portmap_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_nodes(portmap_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_nodes(portmap_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(portmap_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(portmap_t)
Chris PeBenito 17de1b
corenet_tcp_bind_all_nodes(portmap_t)
Chris PeBenito 17de1b
corenet_udp_bind_all_nodes(portmap_t)
Chris PeBenito 17de1b
corenet_tcp_bind_portmap_port(portmap_t)
Chris PeBenito 17de1b
corenet_udp_bind_portmap_port(portmap_t)
Chris PeBenito 17de1b
corenet_tcp_connect_all_ports(portmap_t)
Chris PeBenito 17de1b
corenet_sendrecv_portmap_client_packets(portmap_t)
Chris PeBenito 17de1b
corenet_sendrecv_portmap_server_packets(portmap_t)
Chris PeBenito 17de1b
# portmap binds to arbitary ports
Chris PeBenito 17de1b
corenet_tcp_bind_generic_port(portmap_t)
Chris PeBenito 17de1b
corenet_udp_bind_generic_port(portmap_t)
Chris PeBenito 17de1b
corenet_tcp_bind_reserved_port(portmap_t)
Chris PeBenito 17de1b
corenet_udp_bind_reserved_port(portmap_t)
Chris PeBenito 17de1b
corenet_dontaudit_tcp_bind_all_reserved_ports(portmap_t)
Chris PeBenito 17de1b
corenet_dontaudit_udp_bind_all_reserved_ports(portmap_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_sysfs(portmap_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_all_fs(portmap_t)
Chris PeBenito 17de1b
fs_search_auto_mountpoints(portmap_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_dontaudit_use_console(portmap_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(portmap_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(portmap_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_use_fds(portmap_t)
Chris PeBenito 17de1b
init_use_script_ptys(portmap_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_use_ld_so(portmap_t)
Chris PeBenito 17de1b
libs_use_shared_libs(portmap_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(portmap_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(portmap_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(portmap_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(portmap_t)
Chris PeBenito 17de1b
userdom_dontaudit_search_sysadm_home_dirs(portmap_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`targeted_policy', `
Chris PeBenito 17de1b
	term_dontaudit_use_unallocated_ttys(portmap_t)
Chris PeBenito 17de1b
	term_dontaudit_use_generic_ptys(portmap_t)
Chris PeBenito 17de1b
	files_dontaudit_read_root_files(portmap_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nis_use_ypbind(portmap_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nscd_socket_use(portmap_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(portmap_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(portmap_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Portmap helper local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dontaudit portmap_helper_t self:capability net_admin;
Chris PeBenito 17de1b
allow portmap_helper_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito 17de1b
allow portmap_helper_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow portmap_helper_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow portmap_helper_t portmap_var_run_t:file manage_file_perms;
Chris PeBenito 17de1b
files_pid_filetrans(portmap_helper_t,portmap_var_run_t,file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_if(portmap_helper_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_if(portmap_helper_t)
Chris PeBenito 17de1b
corenet_raw_sendrecv_all_if(portmap_helper_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_nodes(portmap_helper_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_nodes(portmap_helper_t)
Chris PeBenito 17de1b
corenet_raw_sendrecv_all_nodes(portmap_helper_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(portmap_helper_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(portmap_helper_t)
Chris PeBenito 17de1b
corenet_non_ipsec_sendrecv(portmap_helper_t)
Chris PeBenito 17de1b
corenet_tcp_bind_all_nodes(portmap_helper_t)
Chris PeBenito 17de1b
corenet_udp_bind_all_nodes(portmap_helper_t)
Chris PeBenito 17de1b
corenet_tcp_bind_reserved_port(portmap_helper_t)
Chris PeBenito 17de1b
corenet_udp_bind_reserved_port(portmap_helper_t)
Chris PeBenito 17de1b
corenet_dontaudit_tcp_bind_all_reserved_ports(portmap_helper_t)
Chris PeBenito 17de1b
corenet_dontaudit_udp_bind_all_reserved_ports(portmap_helper_t)
Chris PeBenito 17de1b
corenet_tcp_connect_all_ports(portmap_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_dontaudit_use_interactive_fds(portmap_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(portmap_helper_t)
Chris PeBenito 17de1b
files_rw_generic_pids(portmap_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_rw_utmp(portmap_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_use_ld_so(portmap_helper_t)
Chris PeBenito 17de1b
libs_use_shared_libs(portmap_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(portmap_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(portmap_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_all_users_fds(portmap_helper_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`targeted_policy', `
Chris PeBenito 17de1b
	term_dontaudit_use_unallocated_ttys(portmap_helper_t)
Chris PeBenito 17de1b
	term_dontaudit_use_generic_ptys(portmap_helper_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nis_use_ypbind(portmap_helper_t)
Chris PeBenito 17de1b
')