Chris PeBenito 17de1b
Chris PeBenito 9570b2
policy_module(nx, 1.4.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
Chris PeBenito 17de1b
type nx_server_var_run_t;
Chris PeBenito 17de1b
files_pid_file(nx_server_var_run_t)
Chris PeBenito 17de1b
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
Chris PeBenito c0868a
allow nx_server_t nx_server_devpts_t:chr_file { rw_chr_file_perms setattr };
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
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
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',`
Chris PeBenito 17de1b
# clients already have create permissions; the nxclient wants to also have unlink rights
Chris PeBenito 17de1b
allow userdomain xdm_tmp_t:sock_file unlink;
Chris PeBenito 17de1b
# for a lockfile created by the client process
Chris PeBenito 17de1b
allow nx_server_t user_tmpfile:file getattr;
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)