Chris PeBenito 9570b2
policy_module(portslave, 1.7.0)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type portslave_t;
Chris PeBenito 17de1b
type portslave_exec_t;
Chris PeBenito 0bfccd
init_domain(portslave_t, portslave_exec_t)
Chris PeBenito 0bfccd
init_daemon_domain(portslave_t, portslave_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type portslave_etc_t;
Chris PeBenito 6224fc
files_config_file(portslave_etc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type portslave_lock_t;
Chris PeBenito 17de1b
files_lock_file(portslave_lock_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# setuid setgid net_admin fsetid for pppd
Chris PeBenito 17de1b
# sys_admin for ctlportslave
Chris PeBenito 17de1b
# net_bind_service for rlogin
Chris PeBenito 17de1b
allow portslave_t self:capability { setuid setgid net_admin fsetid net_bind_service sys_tty_config };
Chris PeBenito 17de1b
dontaudit portslave_t self:capability sys_admin;
Chris PeBenito 17de1b
allow portslave_t self:process signal_perms;
Chris PeBenito 17de1b
allow portslave_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 17de1b
allow portslave_t self:fd use;
Chris PeBenito c0868a
allow portslave_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow portslave_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow portslave_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow portslave_t self:unix_dgram_socket sendto;
Chris PeBenito 17de1b
allow portslave_t self:unix_stream_socket connectto;
Chris PeBenito 17de1b
allow portslave_t self:shm create_shm_perms;
Chris PeBenito 17de1b
allow portslave_t self:sem create_sem_perms;
Chris PeBenito 17de1b
allow portslave_t self:msgq create_msgq_perms;
Chris PeBenito 17de1b
allow portslave_t self:msg { send receive };
Chris PeBenito 17de1b
allow portslave_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow portslave_t self:udp_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow portslave_t portslave_etc_t:dir list_dir_perms;
Chris PeBenito 0bfccd
read_files_pattern(portslave_t, portslave_etc_t, portslave_etc_t)
Chris PeBenito 0bfccd
read_lnk_files_pattern(portslave_t, portslave_etc_t, portslave_etc_t)
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow portslave_t portslave_lock_t:file manage_file_perms;
Chris PeBenito 0bfccd
files_lock_filetrans(portslave_t, portslave_lock_t, file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_system_state(portslave_t)
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(portslave_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
corecmd_exec_bin(portslave_t)
Chris PeBenito 17de1b
corecmd_exec_shell(portslave_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(portslave_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(portslave_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_generic_if(portslave_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_generic_if(portslave_t)
Chris PeBenito c12621
corenet_tcp_sendrecv_generic_node(portslave_t)
Chris PeBenito c12621
corenet_udp_sendrecv_generic_node(portslave_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(portslave_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(portslave_t)
Chris PeBenito 17de1b
corenet_rw_ppp_dev(portslave_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_sysfs(portslave_t)
Chris PeBenito 17de1b
# for ssh
Chris PeBenito 17de1b
dev_read_urand(portslave_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(portslave_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(portslave_t)
Chris PeBenito 17de1b
files_read_etc_runtime_files(portslave_t)
Chris PeBenito 17de1b
files_exec_etc_files(portslave_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_search_auto_mountpoints(portslave_t)
Chris PeBenito 17de1b
fs_getattr_xattr_fs(portslave_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_use_unallocated_ttys(portslave_t)
Chris PeBenito 17de1b
term_setattr_unallocated_ttys(portslave_t)
Chris PeBenito c3c753
term_use_all_ttys(portslave_t)
Chris PeBenito 17de1b
term_search_ptys(portslave_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
auth_rw_login_records(portslave_t)
Chris PeBenito 17de1b
auth_domtrans_chk_passwd(portslave_t)
Chris PeBenito a5f5eb
Chris PeBenito 17de1b
init_rw_utmp(portslave_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(portslave_t)
Chris PeBenito 17de1b
logging_search_logs(portslave_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_read_config(portslave_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_use_unpriv_users_fds(portslave_t)
Chris PeBenito 17de1b
# for ~/.ppprc - if it actually exists then you need some policy to read it
Chris PeBenito 296273
userdom_search_user_home_dirs(portslave_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
mta_send_mail(portslave_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# this should probably be a domtrans to pppd
Chris PeBenito 17de1b
# instead of exec.
Chris PeBenito 17de1b
ppp_read_rw_config(portslave_t)
Chris PeBenito 17de1b
ppp_exec(portslave_t)
Chris PeBenito 17de1b
ppp_read_secrets(portslave_t)
Chris PeBenito 17de1b
ppp_manage_pid_files(portslave_t)
Chris PeBenito 17de1b
ppp_pid_filetrans(portslave_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ssh_exec(portslave_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 0bfccd
	inetd_tcp_service_domain(portslave_t, portslave_exec_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nis_use_ypbind(portslave_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(portslave_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(portslave_t)
Chris PeBenito 17de1b
')