Chris PeBenito 29af4c
policy_module(ppp, 1.12.0)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 56e1b3
## <desc>
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## Allow pppd to load kernel modules for certain modems
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## </desc>
Chris PeBenito 0bfccd
gen_tunable(pppd_can_insmod, false)
Chris PeBenito 56e1b3
Chris PeBenito 56e1b3
## <desc>
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## Allow pppd to be run for a regular user
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## </desc>
Chris PeBenito 0bfccd
gen_tunable(pppd_for_user, false)
Chris PeBenito 56e1b3
Chris PeBenito 17de1b
# pppd_t is the domain for the pppd program.
Chris PeBenito 17de1b
# pppd_exec_t is the type of the pppd executable.
Chris PeBenito 17de1b
type pppd_t;
Chris PeBenito 17de1b
type pppd_exec_t;
Chris PeBenito 0bfccd
init_daemon_domain(pppd_t, pppd_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type pppd_devpts_t;
Chris PeBenito 17de1b
term_pty(pppd_devpts_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Define a separate type for /etc/ppp
Chris PeBenito 17de1b
type pppd_etc_t;
Chris PeBenito 17de1b
files_config_file(pppd_etc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Define a separate type for writable files under /etc/ppp
Chris PeBenito 17de1b
type pppd_etc_rw_t;
Chris PeBenito 17de1b
files_type(pppd_etc_rw_t)
Chris PeBenito 17de1b
Chris PeBenito 7395f8
type pppd_initrc_exec_t alias pppd_script_exec_t;
Chris PeBenito 82b5d2
init_script_file(pppd_initrc_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# pppd_secret_t is the type of the pap and chap password files
Chris PeBenito 17de1b
type pppd_secret_t;
Chris PeBenito 17de1b
files_type(pppd_secret_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type pppd_log_t;
Chris PeBenito 17de1b
logging_log_file(pppd_log_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type pppd_lock_t;
Chris PeBenito 17de1b
files_lock_file(pppd_lock_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type pppd_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(pppd_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type pppd_var_run_t;
Chris PeBenito 17de1b
files_pid_file(pppd_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type pptp_t;
Chris PeBenito 17de1b
type pptp_exec_t;
Chris PeBenito 0bfccd
init_daemon_domain(pptp_t, pptp_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type pptp_log_t;
Chris PeBenito 17de1b
logging_log_file(pptp_log_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type pptp_var_run_t;
Chris PeBenito 17de1b
files_pid_file(pptp_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# PPPD Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito ae3386
allow pppd_t self:capability { kill net_admin setuid setgid fsetid fowner net_raw dac_override };
Chris PeBenito 17de1b
dontaudit pppd_t self:capability sys_tty_config;
Chris PeBenito 38db49
allow pppd_t self:process { getsched signal };
Chris PeBenito c0868a
allow pppd_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow pppd_t self:socket create_socket_perms;
Chris PeBenito 17de1b
allow pppd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow pppd_t self:unix_stream_socket create_socket_perms;
Chris PeBenito 8708d9
allow pppd_t self:netlink_route_socket rw_netlink_socket_perms;
Chris PeBenito 17de1b
allow pppd_t self:tcp_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow pppd_t self:udp_socket { connect connected_socket_perms };
Chris PeBenito 17de1b
allow pppd_t self:packet_socket create_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
domtrans_pattern(pppd_t, pptp_exec_t, pptp_t)
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow pppd_t pppd_devpts_t:chr_file { rw_chr_file_perms setattr };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow pppd_t pppd_etc_t:dir rw_dir_perms;
Chris PeBenito c0868a
allow pppd_t pppd_etc_t:file read_file_perms;
Chris PeBenito 17de1b
allow pppd_t pppd_etc_t:lnk_file { getattr read };
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_files_pattern(pppd_t, pppd_etc_rw_t, pppd_etc_rw_t)
Chris PeBenito 8708d9
# Automatically label newly created files under /etc/ppp with this type
Chris PeBenito 0bfccd
filetrans_pattern(pppd_t, pppd_etc_t, pppd_etc_rw_t, file)
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow pppd_t pppd_lock_t:file manage_file_perms;
Chris PeBenito 0bfccd
files_lock_filetrans(pppd_t, pppd_lock_t, file)
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow pppd_t pppd_log_t:file manage_file_perms;
Chris PeBenito 0bfccd
logging_log_filetrans(pppd_t, pppd_log_t, file)
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_dirs_pattern(pppd_t, pppd_tmp_t, pppd_tmp_t)
Chris PeBenito 0bfccd
manage_files_pattern(pppd_t, pppd_tmp_t, pppd_tmp_t)
Chris PeBenito 17de1b
files_tmp_filetrans(pppd_t, pppd_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_files_pattern(pppd_t, pppd_var_run_t, pppd_var_run_t)
Chris PeBenito 0bfccd
files_pid_filetrans(pppd_t, pppd_var_run_t, file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow pppd_t pptp_t:process signal;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# for SSP
Chris PeBenito 17de1b
# Access secret files
Chris PeBenito c0868a
allow pppd_t pppd_secret_t:file read_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 7395f8
ppp_initrc_domtrans(pppd_t)
Chris PeBenito 7395f8
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(pppd_t)
Chris PeBenito 17de1b
kernel_read_system_state(pppd_t)
Chris PeBenito ae3386
kernel_rw_net_sysctls(pppd_t)
Chris PeBenito 17de1b
kernel_read_network_state(pppd_t)
Chris PeBenito 82b5d2
kernel_request_load_module(pppd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_urand(pppd_t)
Chris PeBenito 17de1b
dev_search_sysfs(pppd_t)
Chris PeBenito 17de1b
dev_read_sysfs(pppd_t)
Chris PeBenito 38db49
dev_rw_modem(pppd_t)
Chris PeBenito 17de1b
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(pppd_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(pppd_t)
Chris PeBenito 668b30
corenet_tcp_sendrecv_generic_if(pppd_t)
Chris PeBenito 668b30
corenet_raw_sendrecv_generic_if(pppd_t)
Chris PeBenito 668b30
corenet_udp_sendrecv_generic_if(pppd_t)
Chris PeBenito c12621
corenet_tcp_sendrecv_generic_node(pppd_t)
Chris PeBenito c12621
corenet_raw_sendrecv_generic_node(pppd_t)
Chris PeBenito c12621
corenet_udp_sendrecv_generic_node(pppd_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(pppd_t)
Chris PeBenito 17de1b
corenet_udp_sendrecv_all_ports(pppd_t)
Chris PeBenito 17de1b
# Access /dev/ppp.
Chris PeBenito 17de1b
corenet_rw_ppp_dev(pppd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_getattr_all_fs(pppd_t)
Chris PeBenito 17de1b
fs_search_auto_mountpoints(pppd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_use_unallocated_ttys(pppd_t)
Chris PeBenito 17de1b
term_setattr_unallocated_ttys(pppd_t)
Chris PeBenito 17de1b
term_ioctl_generic_ptys(pppd_t)
Chris PeBenito 17de1b
# for pppoe
Chris PeBenito 0bfccd
term_create_pty(pppd_t, pppd_devpts_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# allow running ip-up and ip-down scripts and running chat.
Chris PeBenito 17de1b
corecmd_exec_bin(pppd_t)
Chris PeBenito 17de1b
corecmd_exec_shell(pppd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(pppd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_exec_etc_files(pppd_t)
Chris PeBenito 8708d9
files_manage_etc_runtime_files(pppd_t)
Chris PeBenito 8708d9
files_dontaudit_write_etc_files(pppd_t)
Chris PeBenito 8708d9
Chris PeBenito 17de1b
# for scripts
Chris PeBenito 17de1b
files_read_etc_files(pppd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_read_utmp(pppd_t)
Chris PeBenito 17de1b
init_dontaudit_write_utmp(pppd_t)
Chris PeBenito 7395f8
init_signal_script(pppd_t)
Chris PeBenito 17de1b
Chris PeBenito 7a5e2d
auth_use_nsswitch(pppd_t)
Chris PeBenito 7a5e2d
Chris PeBenito 17de1b
logging_send_syslog_msg(pppd_t)
Chris PeBenito 38db49
logging_send_audit_msgs(pppd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(pppd_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
sysnet_exec_ifconfig(pppd_t)
Chris PeBenito 17de1b
sysnet_manage_config(pppd_t)
Chris PeBenito f6a590
sysnet_etc_filetrans_config(pppd_t)
Chris PeBenito 17de1b
Chris PeBenito 296273
userdom_use_user_terminals(pppd_t)
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(pppd_t)
Chris PeBenito 296273
userdom_search_user_home_dirs(pppd_t)
Chris PeBenito 17de1b
Chris PeBenito 8708d9
ppp_exec(pppd_t)
Chris PeBenito 8708d9
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	ddclient_domtrans(pppd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	tunable_policy(`pppd_can_insmod && ! secure_mode_insmod',`
Chris PeBenito 17de1b
		modutils_domtrans_insmod_uncond(pppd_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	mta_send_mail(pppd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito ae3386
	networkmanager_signal(pppd_t)
Chris PeBenito ae3386
')
Chris PeBenito ae3386
Chris PeBenito ae3386
optional_policy(`
Chris PeBenito 56e1b3
	postfix_domtrans_master(pppd_t)
Chris PeBenito 56e1b3
')
Chris PeBenito 56e1b3
Chris PeBenito 56e1b3
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(pppd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(pppd_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# PPTP Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 82b5d2
allow pptp_t self:capability { dac_override dac_read_search net_raw net_admin };
Chris PeBenito 7a5e2d
dontaudit pptp_t self:capability sys_tty_config;
Chris PeBenito 7a5e2d
allow pptp_t self:process signal;
Chris PeBenito 0b36a2
allow pptp_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 17de1b
allow pptp_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow pptp_t self:unix_stream_socket { connectto create_stream_socket_perms };
Chris PeBenito 17de1b
allow pptp_t self:rawip_socket create_socket_perms;
Chris PeBenito 17de1b
allow pptp_t self:tcp_socket create_socket_perms;
Chris PeBenito 7395f8
allow pptp_t self:udp_socket create_socket_perms;
Chris PeBenito 7395f8
allow pptp_t self:netlink_route_socket rw_netlink_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 0b36a2
allow pptp_t pppd_etc_t:dir list_dir_perms;
Chris PeBenito 0b36a2
allow pptp_t pppd_etc_t:file read_file_perms;
Chris PeBenito 7395f8
allow pptp_t pppd_etc_t:lnk_file read_lnk_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 0b36a2
allow pptp_t pppd_etc_rw_t:dir list_dir_perms;
Chris PeBenito 0b36a2
allow pptp_t pppd_etc_rw_t:file read_file_perms;
Chris PeBenito 7395f8
allow pptp_t pppd_etc_rw_t:lnk_file read_lnk_file_perms;
Chris PeBenito 17de1b
can_exec(pptp_t, pppd_etc_rw_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Allow pptp to append to pppd log files
Chris PeBenito 0b36a2
allow pptp_t pppd_log_t:file append_file_perms;
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow pptp_t pptp_log_t:file manage_file_perms;
Chris PeBenito 0bfccd
logging_log_filetrans(pptp_t, pptp_log_t, file)
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
manage_files_pattern(pptp_t, pptp_var_run_t, pptp_var_run_t)
Chris PeBenito 0bfccd
manage_sock_files_pattern(pptp_t, pptp_var_run_t, pptp_var_run_t)
Chris PeBenito 0bfccd
files_pid_filetrans(pptp_t, pptp_var_run_t, file)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_list_proc(pptp_t)
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(pptp_t)
Chris PeBenito 17de1b
kernel_read_proc_symlinks(pptp_t)
Chris PeBenito 7395f8
kernel_read_system_state(pptp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_sysfs(pptp_t)
Chris PeBenito 17de1b
Chris PeBenito 7395f8
corecmd_exec_shell(pptp_t)
Chris PeBenito 7395f8
corecmd_read_bin_symlinks(pptp_t)
Chris PeBenito 7395f8
Chris PeBenito 190066
corenet_all_recvfrom_unlabeled(pptp_t)
Chris PeBenito 190066
corenet_all_recvfrom_netlabel(pptp_t)
Chris PeBenito 668b30
corenet_tcp_sendrecv_generic_if(pptp_t)
Chris PeBenito 668b30
corenet_raw_sendrecv_generic_if(pptp_t)
Chris PeBenito c12621
corenet_tcp_sendrecv_generic_node(pptp_t)
Chris PeBenito c12621
corenet_raw_sendrecv_generic_node(pptp_t)
Chris PeBenito 17de1b
corenet_tcp_sendrecv_all_ports(pptp_t)
Chris PeBenito c12621
corenet_tcp_bind_generic_node(pptp_t)
Chris PeBenito 17de1b
corenet_tcp_connect_generic_port(pptp_t)
Chris PeBenito 17de1b
corenet_tcp_connect_all_reserved_ports(pptp_t)
Chris PeBenito 17de1b
corenet_sendrecv_generic_client_packets(pptp_t)
Chris PeBenito 17de1b
Chris PeBenito 7395f8
files_read_etc_files(pptp_t)
Chris PeBenito 7395f8
Chris PeBenito 17de1b
fs_getattr_all_fs(pptp_t)
Chris PeBenito 17de1b
fs_search_auto_mountpoints(pptp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_ioctl_generic_ptys(pptp_t)
Chris PeBenito 17de1b
term_search_ptys(pptp_t)
Chris PeBenito 17de1b
term_use_ptmx(pptp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(pptp_t)
Chris PeBenito 17de1b
Chris PeBenito 7395f8
auth_use_nsswitch(pptp_t)
Chris PeBenito 7395f8
Chris PeBenito 17de1b
logging_send_syslog_msg(pptp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(pptp_t)
Chris PeBenito 17de1b
Chris PeBenito 7395f8
sysnet_exec_ifconfig(pptp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(pptp_t)
Chris PeBenito 296273
userdom_dontaudit_search_user_home_dirs(pptp_t)
Chris PeBenito 38db49
userdom_signal_unpriv_users(pptp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 8708d9
	consoletype_exec(pppd_t)
Chris PeBenito 8708d9
')
Chris PeBenito 8708d9
Chris PeBenito 8708d9
optional_policy(`
Chris PeBenito 82b5d2
	dbus_system_domain(pppd_t, pppd_exec_t)
Chris PeBenito 82b5d2
Chris PeBenito 82b5d2
	optional_policy(`
Chris PeBenito 82b5d2
		networkmanager_dbus_chat(pppd_t)
Chris PeBenito 82b5d2
	')
Chris PeBenito 82b5d2
')
Chris PeBenito 82b5d2
Chris PeBenito 82b5d2
optional_policy(`
Chris PeBenito 17de1b
	hostname_exec(pptp_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 6073ea
	seutil_sigchld_newrole(pptp_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 6073ea
	udev_read_db(pptp_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	postfix_read_config(pppd_t)
Chris PeBenito 17de1b
')