Chris PeBenito e08118
Chris PeBenito d3d270
policy_module(ppp,1.2.0)
Chris PeBenito e08118
Chris PeBenito e08118
########################################
Chris PeBenito e08118
#
Chris PeBenito e08118
# Declarations
Chris PeBenito e08118
#
Chris PeBenito e08118
Chris PeBenito e08118
# pppd_t is the domain for the pppd program.
Chris PeBenito e08118
# pppd_exec_t is the type of the pppd executable.
Chris PeBenito e08118
type pppd_t;
Chris PeBenito e08118
type pppd_exec_t;
Chris PeBenito e08118
init_daemon_domain(pppd_t,pppd_exec_t)
Chris PeBenito e08118
Chris PeBenito e08118
type pppd_devpts_t;
Chris PeBenito e08118
term_pty(pppd_devpts_t)
Chris PeBenito e08118
Chris PeBenito e08118
# Define a separate type for /etc/ppp
Chris PeBenito 9bbc75
type pppd_etc_t;
Chris PeBenito 9bbc75
files_config_file(pppd_etc_t)
Chris PeBenito e08118
Chris PeBenito e08118
# Define a separate type for writable files under /etc/ppp
Chris PeBenito e08118
type pppd_etc_rw_t;
Chris PeBenito e08118
files_type(pppd_etc_rw_t)
Chris PeBenito e08118
Chris PeBenito e08118
type pppd_script_exec_t;
Chris PeBenito e08118
files_type(pppd_script_exec_t)
Chris PeBenito e08118
Chris PeBenito e08118
# pppd_secret_t is the type of the pap and chap password files
Chris PeBenito e08118
type pppd_secret_t;
Chris PeBenito e08118
files_type(pppd_secret_t)
Chris PeBenito e08118
Chris PeBenito e08118
type pppd_log_t;
Chris PeBenito e08118
logging_log_file(pppd_log_t)
Chris PeBenito e08118
Chris PeBenito e08118
type pppd_lock_t;
Chris PeBenito e08118
files_lock_file(pppd_lock_t)
Chris PeBenito e08118
Chris PeBenito e08118
type pppd_tmp_t;
Chris PeBenito e08118
files_tmp_file(pppd_tmp_t)
Chris PeBenito e08118
Chris PeBenito e08118
type pppd_var_run_t;
Chris PeBenito e08118
files_pid_file(pppd_var_run_t)
Chris PeBenito e08118
Chris PeBenito e08118
type pptp_t;
Chris PeBenito e08118
type pptp_exec_t;
Chris PeBenito e08118
init_daemon_domain(pptp_t,pptp_exec_t)
Chris PeBenito e08118
Chris PeBenito e08118
type pptp_log_t;
Chris PeBenito e08118
logging_log_file(pptp_log_t)
Chris PeBenito e08118
Chris PeBenito e08118
type pptp_var_run_t;
Chris PeBenito e08118
files_pid_file(pptp_var_run_t)
Chris PeBenito e08118
Chris PeBenito e08118
########################################
Chris PeBenito e08118
#
Chris PeBenito e08118
# PPPD Local policy
Chris PeBenito e08118
#
Chris PeBenito e08118
Chris PeBenito e08118
dontaudit pppd_t self:capability sys_tty_config;
Chris PeBenito e08118
allow pppd_t self:capability { net_admin setuid setgid fsetid fowner net_raw dac_override };
Chris PeBenito e08118
allow pppd_t self:fifo_file rw_file_perms;
Chris PeBenito e08118
allow pppd_t self:file { read getattr };
Chris PeBenito e08118
allow pppd_t self:socket create_socket_perms;
Chris PeBenito e08118
allow pppd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito e08118
allow pppd_t self:unix_stream_socket create_socket_perms;
Chris PeBenito e08118
allow pppd_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito e08118
allow pppd_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito e08118
allow pppd_t self:udp_socket { connect connected_socket_perms };
Chris PeBenito e08118
allow pppd_t self:packet_socket create_socket_perms;
Chris PeBenito e08118
Chris PeBenito e08118
domain_auto_trans(pppd_t, pptp_exec_t, pptp_t)
Chris PeBenito 4614e8
allow pppd_t pptp_t:fd use;
Chris PeBenito 4614e8
allow pptp_t pppd_t:fd use;
Chris PeBenito 4614e8
allow pptp_t pppd_t:fifo_file rw_file_perms;
Chris PeBenito 4614e8
allow pptp_t pppd_t:process sigchld;
Chris PeBenito e08118
Chris PeBenito e08118
allow pppd_t pppd_devpts_t:chr_file { rw_file_perms setattr };
Chris PeBenito e08118
Chris PeBenito e08118
allow pppd_t pppd_etc_t:dir rw_dir_perms;
Chris PeBenito e08118
allow pppd_t pppd_etc_t:file r_file_perms;
Chris PeBenito e08118
allow pppd_t pppd_etc_t:lnk_file { getattr read };
Chris PeBenito 9d5949
files_filetrans_etc(pppd_t,pppd_etc_t)
Chris PeBenito e08118
Chris PeBenito e08118
allow pppd_t pppd_etc_rw_t:file create_file_perms;
Chris PeBenito e08118
Chris PeBenito e08118
allow pppd_t pppd_lock_t:file create_file_perms;
Chris PeBenito 9d5949
files_filetrans_lock(pppd_t,pppd_lock_t)
Chris PeBenito e08118
Chris PeBenito e08118
allow pppd_t pppd_log_t:file create_file_perms;
Chris PeBenito 9d5949
logging_filetrans_log(pppd_t,pppd_log_t)
Chris PeBenito e08118
Chris PeBenito e08118
allow pppd_t pppd_tmp_t:dir create_dir_perms;
Chris PeBenito e08118
allow pppd_t pppd_tmp_t:file create_file_perms;
Chris PeBenito 9d5949
files_filetrans_tmp(pppd_t, pppd_tmp_t, { file dir })
Chris PeBenito e08118
Chris PeBenito e08118
allow pppd_t pppd_var_run_t:dir rw_dir_perms;
Chris PeBenito e08118
allow pppd_t pppd_var_run_t:file create_file_perms;
Chris PeBenito 9d5949
files_filetrans_pid(pppd_t,pppd_var_run_t)
Chris PeBenito e08118
Chris PeBenito e08118
allow pppd_t pptp_t:process signal;
Chris PeBenito e08118
Chris PeBenito e08118
# for SSP
Chris PeBenito e08118
# Access secret files
Chris PeBenito e08118
allow pppd_t pppd_secret_t:file r_file_perms;
Chris PeBenito e08118
Chris PeBenito e08118
# Automatically label newly created files under /etc/ppp with this type
Chris PeBenito e08118
type_transition pppd_t pppd_etc_t:file pppd_etc_rw_t;
Chris PeBenito e08118
Chris PeBenito 445522
kernel_read_kernel_sysctls(pppd_t)
Chris PeBenito 725926
kernel_read_system_state(pppd_t)
Chris PeBenito 445522
kernel_read_net_sysctls(pppd_t)
Chris PeBenito e08118
kernel_read_network_state(pppd_t)
Chris PeBenito e08118
kernel_load_module(pppd_t)
Chris PeBenito e08118
Chris PeBenito e08118
dev_read_urand(pppd_t)
Chris PeBenito e08118
dev_search_sysfs(pppd_t)
Chris PeBenito e08118
dev_read_sysfs(pppd_t)
Chris PeBenito e08118
Chris PeBenito e08118
corenet_tcp_sendrecv_all_if(pppd_t)
Chris PeBenito e08118
corenet_raw_sendrecv_all_if(pppd_t)
Chris PeBenito e08118
corenet_udp_sendrecv_all_if(pppd_t)
Chris PeBenito e08118
corenet_tcp_sendrecv_all_nodes(pppd_t)
Chris PeBenito e08118
corenet_raw_sendrecv_all_nodes(pppd_t)
Chris PeBenito e08118
corenet_udp_sendrecv_all_nodes(pppd_t)
Chris PeBenito e08118
corenet_tcp_sendrecv_all_ports(pppd_t)
Chris PeBenito e08118
corenet_udp_sendrecv_all_ports(pppd_t)
Chris PeBenito bd7037
corenet_non_ipsec_sendrecv(pppd_t)
Chris PeBenito e08118
corenet_tcp_bind_all_nodes(pppd_t)
Chris PeBenito e08118
corenet_udp_bind_all_nodes(pppd_t)
Chris PeBenito e08118
# Access /dev/ppp.
Chris PeBenito 5b6ddb
corenet_rw_ppp_dev(pppd_t)
Chris PeBenito e08118
Chris PeBenito e08118
fs_getattr_all_fs(pppd_t)
Chris PeBenito e08118
fs_search_auto_mountpoints(pppd_t)
Chris PeBenito e08118
Chris PeBenito 1815ba
term_use_unallocated_ttys(pppd_t)
Chris PeBenito e08118
term_setattr_unallocated_ttys(pppd_t)
Chris PeBenito 1815ba
term_ioctl_generic_ptys(pppd_t)
Chris PeBenito e08118
# for pppoe
Chris PeBenito e08118
term_create_pty(pppd_t,pppd_devpts_t)
Chris PeBenito e08118
term_dontaudit_use_console(pppd_t)
Chris PeBenito e08118
Chris PeBenito e08118
# allow running ip-up and ip-down scripts and running chat.
Chris PeBenito e08118
corecmd_exec_bin(pppd_t)
Chris PeBenito e08118
corecmd_exec_sbin(pppd_t)
Chris PeBenito e08118
corecmd_exec_shell(pppd_t)
Chris PeBenito e08118
Chris PeBenito e08118
domain_use_wide_inherit_fd(pppd_t)
Chris PeBenito e08118
Chris PeBenito e08118
files_exec_etc_files(pppd_t)
Chris PeBenito e08118
files_read_etc_runtime_files(pppd_t)
Chris PeBenito e08118
# for scripts
Chris PeBenito e08118
files_read_etc_files(pppd_t)
Chris PeBenito e08118
Chris PeBenito 68228b
init_read_utmp(pppd_t)
Chris PeBenito 68228b
init_dontaudit_write_utmp(pppd_t)
Chris PeBenito e08118
init_use_fd(pppd_t)
Chris PeBenito 1815ba
init_use_script_ptys(pppd_t)
Chris PeBenito e08118
Chris PeBenito e08118
libs_use_ld_so(pppd_t)
Chris PeBenito e08118
libs_use_shared_libs(pppd_t)
Chris PeBenito e08118
Chris PeBenito e08118
logging_send_syslog_msg(pppd_t)
Chris PeBenito e08118
Chris PeBenito e08118
miscfiles_read_localization(pppd_t)
Chris PeBenito e08118
Chris PeBenito e08118
sysnet_read_config(pppd_t)
Chris PeBenito e08118
sysnet_exec_ifconfig(pppd_t)
Chris PeBenito e08118
sysnet_manage_config(pppd_t)
Chris PeBenito e08118
Chris PeBenito e08118
userdom_dontaudit_use_unpriv_user_fd(pppd_t)
Chris PeBenito e08118
userdom_dontaudit_search_sysadm_home_dir(pppd_t)
Chris PeBenito e08118
# for ~/.ppprc - if it actually exists then you need some policy to read it
Chris PeBenito e08118
#allow pppd_t { sysadm_home_dir_t home_root_t user_home_dir_type }:dir search;
Chris PeBenito e08118
userdom_search_sysadm_home_dir(pppd_t)
Chris PeBenito e08118
userdom_search_unpriv_user_home_dirs(pppd_t)
Chris PeBenito e08118
Chris PeBenito e08118
ifdef(`targeted_policy', `
Chris PeBenito 1815ba
	term_dontaudit_use_unallocated_ttys(pppd_t)
Chris PeBenito 1815ba
	term_dontaudit_use_generic_ptys(pppd_t)
Chris PeBenito 9e04f5
	files_dontaudit_read_root_files(pppd_t)
Chris PeBenito 04926d
Chris PeBenito 132880
	optional_policy(`postfix',`
Chris PeBenito 04926d
		gen_require(`
Chris PeBenito 4614e8
			bool postfix_disable_trans;
Chris PeBenito 04926d
		')
Chris PeBenito 04926d
Chris PeBenito 4614e8
		if(!postfix_disable_trans) {
Chris PeBenito 04926d
			postfix_domtrans_master(pppd_t)
Chris PeBenito 04926d
		}
Chris PeBenito 04926d
	')
Chris PeBenito 04926d
',`
Chris PeBenito 132880
	optional_policy(`postfix',`
Chris PeBenito 04926d
		postfix_domtrans_master(pppd_t)
Chris PeBenito 04926d
	')
Chris PeBenito e08118
')
Chris PeBenito e08118
Chris PeBenito 132880
optional_policy(`modutils',`
Chris PeBenito 8967bf
	tunable_policy(`pppd_can_insmod && ! secure_mode_insmod',`
Chris PeBenito 8967bf
		modutils_domtrans_insmod_uncond(pppd_t)
Chris PeBenito e08118
	')
Chris PeBenito e08118
')
Chris PeBenito e08118
Chris PeBenito 132880
optional_policy(`mta',`
Chris PeBenito 88dd38
	mta_send_mail(pppd_t)
Chris PeBenito 88dd38
')
Chris PeBenito 88dd38
Chris PeBenito 132880
optional_policy(`nis',`
Chris PeBenito e08118
	nis_use_ypbind(pppd_t)
Chris PeBenito e08118
')
Chris PeBenito e08118
Chris PeBenito 132880
optional_policy(`nscd',`
Chris PeBenito 1815ba
	nscd_socket_use(pppd_t)
Chris PeBenito e08118
')
Chris PeBenito e08118
Chris PeBenito 132880
optional_policy(`selinuxutil',`
Chris PeBenito e08118
	seutil_sigchld_newrole(pppd_t)
Chris PeBenito e08118
')
Chris PeBenito e08118
Chris PeBenito 132880
optional_policy(`udev',`
Chris PeBenito e08118
	udev_read_db(pppd_t)
Chris PeBenito e08118
')
Chris PeBenito e08118
Chris PeBenito e08118
########################################
Chris PeBenito e08118
#
Chris PeBenito e08118
# PPTP Local policy
Chris PeBenito e08118
#
Chris PeBenito e08118
Chris PeBenito e08118
dontaudit pptp_t self:capability sys_tty_config;
Chris PeBenito e08118
allow pptp_t self:capability net_raw;
Chris PeBenito e08118
allow pptp_t self:fifo_file { read write };
Chris PeBenito e08118
allow pptp_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito e08118
allow pptp_t self:unix_stream_socket { connectto create_stream_socket_perms };
Chris PeBenito e08118
allow pptp_t self:rawip_socket create_socket_perms;
Chris PeBenito e08118
allow pptp_t self:tcp_socket create_socket_perms;
Chris PeBenito e08118
Chris PeBenito e08118
allow pptp_t pppd_etc_t:dir { getattr read search };
Chris PeBenito e08118
allow pptp_t pppd_etc_t:file { read getattr };
Chris PeBenito e08118
allow pptp_t pppd_etc_t:lnk_file { getattr read };
Chris PeBenito e08118
Chris PeBenito e08118
allow pptp_t pppd_etc_rw_t:dir { getattr read search };
Chris PeBenito e08118
allow pptp_t pppd_etc_rw_t:file { read getattr };
Chris PeBenito e08118
allow pptp_t pppd_etc_rw_t:lnk_file { getattr read };
Chris PeBenito e08118
can_exec(pptp_t, pppd_etc_rw_t)
Chris PeBenito e08118
Chris PeBenito e08118
# Allow pptp to append to pppd log files
Chris PeBenito e08118
allow pptp_t pppd_log_t:file append;
Chris PeBenito e08118
Chris PeBenito e08118
allow pptp_t pptp_log_t:file create_file_perms;
Chris PeBenito 9d5949
logging_filetrans_log(pptp_t,pptp_log_t)
Chris PeBenito e08118
Chris PeBenito e08118
allow pptp_t pptp_var_run_t:file create_file_perms;
Chris PeBenito e08118
allow pptp_t pptp_var_run_t:dir rw_dir_perms;
Chris PeBenito e08118
allow pptp_t pptp_var_run_t:sock_file create_file_perms;
Chris PeBenito 9d5949
files_filetrans_pid(pptp_t,pptp_var_run_t)
Chris PeBenito e08118
Chris PeBenito e08118
kernel_list_proc(pptp_t)
Chris PeBenito 445522
kernel_read_kernel_sysctls(pptp_t)
Chris PeBenito e08118
kernel_read_proc_symlinks(pptp_t)
Chris PeBenito e08118
Chris PeBenito e08118
dev_read_sysfs(pptp_t)
Chris PeBenito e08118
Chris PeBenito e08118
corenet_tcp_sendrecv_all_if(pptp_t)
Chris PeBenito e08118
corenet_raw_sendrecv_all_if(pptp_t)
Chris PeBenito e08118
corenet_tcp_sendrecv_all_nodes(pptp_t)
Chris PeBenito e08118
corenet_raw_sendrecv_all_nodes(pptp_t)
Chris PeBenito e08118
corenet_tcp_sendrecv_all_ports(pptp_t)
Chris PeBenito bd7037
corenet_non_ipsec_sendrecv(pptp_t)
Chris PeBenito e08118
corenet_tcp_bind_all_nodes(pptp_t)
Chris PeBenito e08118
corenet_tcp_connect_generic_port(pptp_t)
Chris PeBenito e08118
corenet_tcp_connect_all_reserved_ports(pptp_t)
Chris PeBenito e08118
Chris PeBenito e08118
fs_getattr_all_fs(pptp_t)
Chris PeBenito e08118
fs_search_auto_mountpoints(pptp_t)
Chris PeBenito e08118
Chris PeBenito e08118
term_dontaudit_use_console(pptp_t)
Chris PeBenito 1815ba
term_ioctl_generic_ptys(pptp_t)
Chris PeBenito e08118
term_search_ptys(pptp_t)
Chris PeBenito e08118
term_use_ptmx(pptp_t)
Chris PeBenito e08118
Chris PeBenito e08118
domain_use_wide_inherit_fd(pptp_t)
Chris PeBenito e08118
Chris PeBenito e08118
init_use_fd(pptp_t)
Chris PeBenito 1815ba
init_use_script_ptys(pptp_t)
Chris PeBenito e08118
Chris PeBenito e08118
libs_use_ld_so(pptp_t)
Chris PeBenito e08118
libs_use_shared_libs(pptp_t)
Chris PeBenito e08118
Chris PeBenito e08118
logging_send_syslog_msg(pptp_t)
Chris PeBenito e08118
Chris PeBenito e08118
miscfiles_read_localization(pptp_t)
Chris PeBenito e08118
Chris PeBenito e08118
sysnet_read_config(pptp_t)
Chris PeBenito e08118
Chris PeBenito e08118
userdom_dontaudit_use_unpriv_user_fd(pptp_t)
Chris PeBenito e08118
userdom_dontaudit_search_sysadm_home_dir(pptp_t)
Chris PeBenito e08118
Chris PeBenito e08118
ifdef(`targeted_policy',`
Chris PeBenito 1815ba
        term_dontaudit_use_unallocated_ttys(pptp_t)
Chris PeBenito 1815ba
        term_dontaudit_use_generic_ptys(pptp_t)
Chris PeBenito 9e04f5
        files_dontaudit_read_root_files(pptp_t)
Chris PeBenito e08118
')
Chris PeBenito e08118
Chris PeBenito 132880
optional_policy(`hostname',`
Chris PeBenito e08118
	hostname_exec(pptp_t)
Chris PeBenito e08118
')
Chris PeBenito e08118
Chris PeBenito 132880
optional_policy(`nscd',`
Chris PeBenito 1815ba
	nscd_socket_use(pptp_t)
Chris PeBenito e08118
')
Chris PeBenito e08118
Chris PeBenito 132880
optional_policy(`selinuxutil',`
Chris PeBenito e08118
        seutil_sigchld_newrole(pptp_t)
Chris PeBenito e08118
')
Chris PeBenito e08118
Chris PeBenito 132880
optional_policy(`udev',`
Chris PeBenito e08118
        udev_read_db(pptp_t)
Chris PeBenito e08118
')
Chris PeBenito e08118
Chris PeBenito bf080a
optional_policy(`postfix',`
Chris PeBenito bf080a
	postfix_read_config(pppd_t)
Chris PeBenito e08118
')
Chris PeBenito 725926
Chris PeBenito 445522
# FIXME:
Chris PeBenito 725926
domain_auto_trans(pppd_t, pppd_script_exec_t, initrc_t)
Chris PeBenito 725926
allow pppd_t initrc_t:fd use;
Chris PeBenito 725926
allow initrc_t pppd_t:fd use;
Chris PeBenito 725926
allow initrc_t pppd_t:fifo_file rw_file_perms;
Chris PeBenito 725926
allow initrc_t pppd_t:process sigchld;