Chris PeBenito 29af4c
policy_module(nx, 1.5.0)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type nx_server_t;
Chris PeBenito 17de1b
type nx_server_exec_t;
Chris PeBenito 17de1b
domain_type(nx_server_t)
Chris PeBenito 0bfccd
domain_entry_file(nx_server_t, nx_server_exec_t)
Chris PeBenito 17de1b
domain_user_exemption_target(nx_server_t)
Chris PeBenito 17de1b
# we need an extra role because nxserver is called from sshd
Chris PeBenito 17de1b
# cjp: do we really need this?
Chris PeBenito 17de1b
role nx_server_r types nx_server_t;
Chris PeBenito 17de1b
allow system_r nx_server_r;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type nx_server_devpts_t;
Chris PeBenito 0bfccd
term_user_pty(nx_server_t, nx_server_devpts_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type nx_server_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(nx_server_tmp_t)
Chris PeBenito 17de1b
Jeremy Solt 316cdb
type nx_server_var_lib_t;
Jeremy Solt 316cdb
files_type(nx_server_var_lib_t)
Jeremy Solt 316cdb
Chris PeBenito 17de1b
type nx_server_var_run_t;
Chris PeBenito 17de1b
files_pid_file(nx_server_var_run_t)
Chris PeBenito 17de1b
Dan Walsh 3eaa99
type nx_server_home_ssh_t;
Dan Walsh 3eaa99
files_type(nx_server_home_ssh_t)
Dan Walsh 3eaa99
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# NX server local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 0b36a2
allow nx_server_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow nx_server_t self:tcp_socket create_socket_perms;
Chris PeBenito 17de1b
allow nx_server_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Dominick Grift 0f7c40
allow nx_server_t nx_server_devpts_t:chr_file { rw_chr_file_perms setattr_chr_file_perms };
Chris PeBenito 3f67f7
term_create_pty(nx_server_t, nx_server_devpts_t)
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_dirs_pattern(nx_server_t, nx_server_tmp_t, nx_server_tmp_t)
Chris PeBenito 0bfccd
manage_files_pattern(nx_server_t, nx_server_tmp_t, nx_server_tmp_t)
Chris PeBenito 17de1b
files_tmp_filetrans(nx_server_t, nx_server_tmp_t, { file dir })
Chris PeBenito 17de1b
Jeremy Solt 316cdb
manage_files_pattern(nx_server_t, nx_server_var_lib_t, nx_server_var_lib_t)
Jeremy Solt 316cdb
manage_dirs_pattern(nx_server_t, nx_server_var_lib_t, nx_server_var_lib_t)
Jeremy Solt 316cdb
files_var_lib_filetrans(nx_server_t, nx_server_var_lib_t, { file dir })
Jeremy Solt 316cdb
Chris PeBenito 0bfccd
manage_files_pattern(nx_server_t, nx_server_var_run_t, nx_server_var_run_t)
Chris PeBenito 0bfccd
files_pid_filetrans(nx_server_t, nx_server_var_run_t, file)
Chris PeBenito 17de1b
Dan Walsh 3eaa99
manage_dirs_pattern(nx_server_t, nx_server_home_ssh_t, nx_server_home_ssh_t)
Dan Walsh 3eaa99
manage_files_pattern(nx_server_t, nx_server_home_ssh_t, nx_server_home_ssh_t)
Dan Walsh 3eaa99
Chris PeBenito 17de1b
kernel_read_system_state(nx_server_t)
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(nx_server_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# nxserver is a shell script --> call other programs
Chris PeBenito 17de1b
corecmd_exec_shell(nx_server_t)
Chris PeBenito 17de1b
corecmd_exec_bin(nx_server_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(nx_server_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(nx_server_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_generic_if(nx_server_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_generic_if(nx_server_t)
Chris PeBenito c12621
corenet_tcp_sendrecv_generic_node(nx_server_t)
Chris PeBenito c12621
corenet_udp_sendrecv_generic_node(nx_server_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(nx_server_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(nx_server_t)
Chris PeBenito 17de1b
corenet_tcp_connect_all_ports(nx_server_t)
Chris PeBenito 17de1b
corenet_sendrecv_all_client_packets(nx_server_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_urand(nx_server_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(nx_server_t)
Chris PeBenito 17de1b
files_read_etc_runtime_files(nx_server_t)
Chris PeBenito 17de1b
# for reading the config files; maybe a separate type, 
Chris PeBenito 17de1b
# but users need to be able to also read the config
Chris PeBenito 17de1b
files_read_usr_files(nx_server_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(nx_server_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
seutil_dontaudit_search_config(nx_server_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(nx_server_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`TODO',`
Dominick Grift 18f2a7
	# clients already have create permissions; the nxclient wants to also have unlink rights
Dominick Grift 18f2a7
	allow userdomain xdm_tmp_t:sock_file delete_sock_file_perms;
Dominick Grift 18f2a7
	# for a lockfile created by the client process
Dominick Grift 18f2a7
	allow nx_server_t user_tmpfile:file getattr_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# SSH component local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
ssh_basic_client_template(nx_server, nx_server_t, nx_server_r)