Chris PeBenito 12cd9a
Chris PeBenito 141cff
policy_module(portslave,1.0.1)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
########################################
Chris PeBenito 12cd9a
#
Chris PeBenito 12cd9a
# Declarations
Chris PeBenito 12cd9a
#
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
type portslave_t;
Chris PeBenito 12cd9a
type portslave_exec_t;
Chris PeBenito 12cd9a
init_domain(portslave_t,portslave_exec_t)
Chris PeBenito 12cd9a
init_daemon_domain(portslave_t,portslave_exec_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
type portslave_etc_t;
Chris PeBenito 12cd9a
files_type(portslave_etc_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
type portslave_lock_t;
Chris PeBenito 12cd9a
files_lock_file(portslave_lock_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
########################################
Chris PeBenito 12cd9a
#
Chris PeBenito 12cd9a
# Local policy
Chris PeBenito 12cd9a
#
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
# setuid setgid net_admin fsetid for pppd
Chris PeBenito 12cd9a
# sys_admin for ctlportslave
Chris PeBenito 12cd9a
# net_bind_service for rlogin
Chris PeBenito 12cd9a
allow portslave_t self:capability { setuid setgid net_admin fsetid net_bind_service sys_tty_config };
Chris PeBenito 12cd9a
dontaudit portslave_t self:capability sys_admin;
Chris PeBenito 12cd9a
allow portslave_t self:process signal_perms;
Chris PeBenito 12cd9a
allow portslave_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 12cd9a
allow portslave_t self:fd use;
Chris PeBenito 12cd9a
allow portslave_t self:fifo_file rw_file_perms;
Chris PeBenito 12cd9a
allow portslave_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 12cd9a
allow portslave_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 12cd9a
allow portslave_t self:unix_dgram_socket sendto;
Chris PeBenito 12cd9a
allow portslave_t self:unix_stream_socket connectto;
Chris PeBenito 12cd9a
allow portslave_t self:shm create_shm_perms;
Chris PeBenito 12cd9a
allow portslave_t self:sem create_sem_perms;
Chris PeBenito 12cd9a
allow portslave_t self:msgq create_msgq_perms;
Chris PeBenito 12cd9a
allow portslave_t self:msg { send receive };
Chris PeBenito 12cd9a
allow portslave_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 12cd9a
allow portslave_t self:udp_socket create_socket_perms;
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
allow portslave_t portslave_etc_t:dir r_dir_perms;
Chris PeBenito 12cd9a
allow portslave_t portslave_etc_t:file r_file_perms;
Chris PeBenito 12cd9a
allow portslave_t portslave_etc_t:lnk_file { getattr read };
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
allow portslave_t portslave_lock_t:file create_file_perms;
Chris PeBenito 12cd9a
files_lock_filetrans(portslave_t,portslave_lock_t,file)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
kernel_read_system_state(portslave_t)
Chris PeBenito 12cd9a
kernel_read_kernel_sysctls(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
corecmd_exec_bin(portslave_t)
Chris PeBenito 12cd9a
corecmd_exec_shell(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
corenet_non_ipsec_sendrecv(portslave_t)
Chris PeBenito 12cd9a
corenet_tcp_sendrecv_generic_if(portslave_t)
Chris PeBenito 12cd9a
corenet_udp_sendrecv_generic_if(portslave_t)
Chris PeBenito 12cd9a
corenet_tcp_sendrecv_all_nodes(portslave_t)
Chris PeBenito 12cd9a
corenet_udp_sendrecv_all_nodes(portslave_t)
Chris PeBenito 12cd9a
corenet_tcp_sendrecv_all_ports(portslave_t)
Chris PeBenito 12cd9a
corenet_udp_sendrecv_all_ports(portslave_t)
Chris PeBenito 12cd9a
corenet_rw_ppp_dev(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
dev_read_sysfs(portslave_t)
Chris PeBenito 12cd9a
# for ssh
Chris PeBenito 12cd9a
dev_read_urand(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
domain_use_interactive_fds(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
files_read_etc_files(portslave_t)
Chris PeBenito 12cd9a
files_read_etc_runtime_files(portslave_t)
Chris PeBenito 12cd9a
files_exec_etc_files(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
fs_search_auto_mountpoints(portslave_t)
Chris PeBenito 12cd9a
fs_getattr_xattr_fs(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
term_use_unallocated_ttys(portslave_t)
Chris PeBenito 12cd9a
term_setattr_unallocated_ttys(portslave_t)
Chris PeBenito 12cd9a
term_use_all_user_ttys(portslave_t)
Chris PeBenito 12cd9a
term_dontaudit_use_console(portslave_t)
Chris PeBenito 12cd9a
term_search_ptys(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
auth_rw_login_records(portslave_t)
Chris PeBenito 12cd9a
auth_domtrans_chk_passwd(portslave_t)
Chris PeBenito 12cd9a
init_use_fds(portslave_t)
Chris PeBenito 12cd9a
init_use_script_ptys(portslave_t)
Chris PeBenito 12cd9a
init_rw_utmp(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
libs_use_ld_so(portslave_t)
Chris PeBenito 12cd9a
libs_use_shared_libs(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
logging_send_syslog_msg(portslave_t)
Chris PeBenito 12cd9a
logging_search_logs(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
sysnet_read_config(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
userdom_use_unpriv_users_fds(portslave_t)
Chris PeBenito 12cd9a
# for ~/.ppprc - if it actually exists then you need some policy to read it
Chris PeBenito 12cd9a
userdom_search_all_users_home_dirs(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
mta_send_mail(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
# this should probably be a domtrans to pppd
Chris PeBenito 12cd9a
# instead of exec.
Chris PeBenito 12cd9a
ppp_read_rw_config(portslave_t)
Chris PeBenito 12cd9a
ppp_exec(portslave_t)
Chris PeBenito 12cd9a
ppp_read_secrets(portslave_t)
Chris PeBenito 12cd9a
ppp_manage_pid_files(portslave_t)
Chris PeBenito 12cd9a
ppp_pid_filetrans(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
ssh_exec(portslave_t)
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
ifdef(`targeted_policy',`
Chris PeBenito 12cd9a
	term_dontaudit_use_unallocated_ttys(portslave_t)
Chris PeBenito 12cd9a
	term_dontaudit_use_generic_ptys(portslave_t)
Chris PeBenito 12cd9a
	files_dontaudit_read_root_files(portslave_t)
Chris PeBenito 12cd9a
')
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
optional_policy(`
Chris PeBenito 12cd9a
	inetd_tcp_service_domain(portslave_t,portslave_exec_t)
Chris PeBenito 12cd9a
')
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
optional_policy(`
Chris PeBenito 12cd9a
	nis_use_ypbind(portslave_t)
Chris PeBenito 12cd9a
')
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
optional_policy(`
Chris PeBenito 12cd9a
	radius_use(portslave_t)
Chris PeBenito 12cd9a
')
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
optional_policy(`
Chris PeBenito 12cd9a
	seutil_sigchld_newrole(portslave_t)
Chris PeBenito 12cd9a
')
Chris PeBenito 12cd9a
Chris PeBenito 12cd9a
optional_policy(`
Chris PeBenito 12cd9a
	udev_read_db(portslave_t)
Chris PeBenito 12cd9a
')