Chris PeBenito 6bd449
Chris PeBenito 141cff
policy_module(nx,1.0.1)
Chris PeBenito 6bd449
Chris PeBenito 6bd449
########################################
Chris PeBenito 6bd449
#
Chris PeBenito 6bd449
# Declarations
Chris PeBenito 6bd449
#
Chris PeBenito 6bd449
Chris PeBenito 6bd449
type nx_server_t;
Chris PeBenito 6bd449
type nx_server_exec_t;
Chris PeBenito 6bd449
domain_type(nx_server_t)
Chris PeBenito 6bd449
domain_entry_file(nx_server_t,nx_server_exec_t)
Chris PeBenito 6bd449
domain_user_exemption_target(nx_server_t)
Chris PeBenito 6bd449
# we need an extra role because nxserver is called from sshd
Chris PeBenito 6bd449
# cjp: do we really need this?
Chris PeBenito 6bd449
role nx_server_r types nx_server_t;
Chris PeBenito 6bd449
allow system_r nx_server_r;
Chris PeBenito 6bd449
Chris PeBenito 6bd449
type nx_server_devpts_t;
Chris PeBenito 6bd449
term_user_pty(nx_server_t,nx_server_devpts_t)
Chris PeBenito 6bd449
Chris PeBenito 6bd449
type nx_server_tmp_t;
Chris PeBenito 6bd449
files_tmp_file(nx_server_tmp_t)
Chris PeBenito 6bd449
Chris PeBenito 6bd449
type nx_server_var_run_t;
Chris PeBenito 6bd449
files_pid_file(nx_server_var_run_t)
Chris PeBenito 6bd449
Chris PeBenito 6bd449
########################################
Chris PeBenito 6bd449
#
Chris PeBenito 6bd449
# NX server local policy
Chris PeBenito 6bd449
#
Chris PeBenito 6bd449
Chris PeBenito 6bd449
allow nx_server_t self:fifo_file { getattr ioctl read write };
Chris PeBenito 6bd449
allow nx_server_t self:tcp_socket create_socket_perms;
Chris PeBenito 6bd449
allow nx_server_t self:udp_socket create_socket_perms;
Chris PeBenito 6bd449
Chris PeBenito 6bd449
allow nx_server_t nx_server_devpts_t:chr_file { rw_file_perms setattr };
Chris PeBenito 6bd449
term_create_pty(nx_server_t,nx_server_devpts_t)
Chris PeBenito 6bd449
Chris PeBenito 6bd449
allow nx_server_t nx_server_tmp_t:dir manage_dir_perms;
Chris PeBenito 6bd449
allow nx_server_t nx_server_tmp_t:file manage_file_perms;
Chris PeBenito 6bd449
files_tmp_filetrans(nx_server_t, nx_server_tmp_t, { file dir })
Chris PeBenito 6bd449
Chris PeBenito 6bd449
allow nx_server_t nx_server_var_run_t:file manage_file_perms;
Chris PeBenito 6bd449
allow nx_server_t nx_server_var_run_t:dir rw_dir_perms;
Chris PeBenito 6bd449
files_pid_filetrans(nx_server_t,nx_server_var_run_t,file)
Chris PeBenito 6bd449
Chris PeBenito 6bd449
kernel_read_system_state(nx_server_t)
Chris PeBenito 6bd449
kernel_read_kernel_sysctls(nx_server_t)
Chris PeBenito 6bd449
Chris PeBenito 6bd449
# nxserver is a shell script --> call other programs
Chris PeBenito 6bd449
corecmd_exec_shell(nx_server_t)
Chris PeBenito 6bd449
corecmd_exec_bin(nx_server_t)
Chris PeBenito 6bd449
Chris PeBenito 6bd449
corenet_non_ipsec_sendrecv(nx_server_t)
Chris PeBenito 6bd449
corenet_tcp_sendrecv_generic_if(nx_server_t)
Chris PeBenito 6bd449
corenet_udp_sendrecv_generic_if(nx_server_t)
Chris PeBenito 6bd449
corenet_tcp_sendrecv_all_nodes(nx_server_t)
Chris PeBenito 6bd449
corenet_udp_sendrecv_all_nodes(nx_server_t)
Chris PeBenito 6bd449
corenet_tcp_sendrecv_all_ports(nx_server_t)
Chris PeBenito 6bd449
corenet_udp_sendrecv_all_ports(nx_server_t)
Chris PeBenito 6bd449
corenet_tcp_connect_all_ports(nx_server_t)
Chris PeBenito 141cff
corenet_sendrecv_all_client_packets(nx_server_t)
Chris PeBenito 6bd449
Chris PeBenito 6bd449
dev_read_urand(nx_server_t)
Chris PeBenito 6bd449
Chris PeBenito 6bd449
files_read_etc_files(nx_server_t)
Chris PeBenito 6bd449
files_read_etc_runtime_files(nx_server_t)
Chris PeBenito 6bd449
# for reading the config files; maybe a separate type, 
Chris PeBenito 6bd449
# but users need to be able to also read the config
Chris PeBenito 6bd449
files_read_usr_files(nx_server_t)
Chris PeBenito 6bd449
Chris PeBenito 6bd449
libs_use_ld_so(nx_server_t)
Chris PeBenito 6bd449
libs_use_shared_libs(nx_server_t)
Chris PeBenito 6bd449
Chris PeBenito 6bd449
miscfiles_read_localization(nx_server_t)
Chris PeBenito 6bd449
Chris PeBenito 6bd449
seutil_dontaudit_search_config(nx_server_t)
Chris PeBenito 6bd449
Chris PeBenito 6bd449
sysnet_read_config(nx_server_t)
Chris PeBenito 6bd449
Chris PeBenito 6bd449
ifdef(`TODO',`
Chris PeBenito 6bd449
# clients already have create permissions; the nxclient wants to also have unlink rights
Chris PeBenito 6bd449
allow userdomain xdm_tmp_t:sock_file unlink;
Chris PeBenito 6bd449
# for a lockfile created by the client process
Chris PeBenito 6bd449
allow nx_server_t user_tmpfile:file getattr;
Chris PeBenito 6bd449
')
Chris PeBenito 6bd449
Chris PeBenito 6bd449
########################################
Chris PeBenito 6bd449
#
Chris PeBenito 6bd449
# SSH component local policy
Chris PeBenito 6bd449
#
Chris PeBenito 6bd449
Chris PeBenito 6bd449
ssh_basic_client_template(nx_server,nx_server_t,nx_server_r)