2005-10-14 20:00:07 +00:00
|
|
|
|
2006-01-17 20:14:04 +00:00
|
|
|
policy_module(ppp,1.2.0)
|
2005-10-14 20:00:07 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
# pppd_t is the domain for the pppd program.
|
|
|
|
# pppd_exec_t is the type of the pppd executable.
|
|
|
|
type pppd_t;
|
|
|
|
type pppd_exec_t;
|
|
|
|
init_daemon_domain(pppd_t,pppd_exec_t)
|
|
|
|
|
|
|
|
type pppd_devpts_t;
|
|
|
|
term_pty(pppd_devpts_t)
|
|
|
|
|
|
|
|
# Define a separate type for /etc/ppp
|
2005-10-24 18:40:24 +00:00
|
|
|
type pppd_etc_t;
|
|
|
|
files_config_file(pppd_etc_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
|
|
|
|
# Define a separate type for writable files under /etc/ppp
|
|
|
|
type pppd_etc_rw_t;
|
|
|
|
files_type(pppd_etc_rw_t)
|
|
|
|
|
|
|
|
type pppd_script_exec_t;
|
|
|
|
files_type(pppd_script_exec_t)
|
|
|
|
|
|
|
|
# pppd_secret_t is the type of the pap and chap password files
|
|
|
|
type pppd_secret_t;
|
|
|
|
files_type(pppd_secret_t)
|
|
|
|
|
|
|
|
type pppd_log_t;
|
|
|
|
logging_log_file(pppd_log_t)
|
|
|
|
|
|
|
|
type pppd_lock_t;
|
|
|
|
files_lock_file(pppd_lock_t)
|
|
|
|
|
|
|
|
type pppd_tmp_t;
|
|
|
|
files_tmp_file(pppd_tmp_t)
|
|
|
|
|
|
|
|
type pppd_var_run_t;
|
|
|
|
files_pid_file(pppd_var_run_t)
|
|
|
|
|
|
|
|
type pptp_t;
|
|
|
|
type pptp_exec_t;
|
|
|
|
init_daemon_domain(pptp_t,pptp_exec_t)
|
|
|
|
|
|
|
|
type pptp_log_t;
|
|
|
|
logging_log_file(pptp_log_t)
|
|
|
|
|
|
|
|
type pptp_var_run_t;
|
|
|
|
files_pid_file(pptp_var_run_t)
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# PPPD Local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
dontaudit pppd_t self:capability sys_tty_config;
|
|
|
|
allow pppd_t self:capability { net_admin setuid setgid fsetid fowner net_raw dac_override };
|
|
|
|
allow pppd_t self:fifo_file rw_file_perms;
|
|
|
|
allow pppd_t self:file { read getattr };
|
|
|
|
allow pppd_t self:socket create_socket_perms;
|
|
|
|
allow pppd_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow pppd_t self:unix_stream_socket create_socket_perms;
|
|
|
|
allow pppd_t self:netlink_route_socket r_netlink_socket_perms;
|
|
|
|
allow pppd_t self:tcp_socket create_stream_socket_perms;
|
|
|
|
allow pppd_t self:udp_socket { connect connected_socket_perms };
|
|
|
|
allow pppd_t self:packet_socket create_socket_perms;
|
|
|
|
|
|
|
|
domain_auto_trans(pppd_t, pptp_exec_t, pptp_t)
|
2005-10-26 21:03:19 +00:00
|
|
|
allow pppd_t pptp_t:fd use;
|
|
|
|
allow pptp_t pppd_t:fd use;
|
|
|
|
allow pptp_t pppd_t:fifo_file rw_file_perms;
|
|
|
|
allow pptp_t pppd_t:process sigchld;
|
2005-10-14 20:00:07 +00:00
|
|
|
|
|
|
|
allow pppd_t pppd_devpts_t:chr_file { rw_file_perms setattr };
|
|
|
|
|
|
|
|
allow pppd_t pppd_etc_t:dir rw_dir_perms;
|
|
|
|
allow pppd_t pppd_etc_t:file r_file_perms;
|
|
|
|
allow pppd_t pppd_etc_t:lnk_file { getattr read };
|
2006-01-13 21:06:49 +00:00
|
|
|
files_filetrans_etc(pppd_t,pppd_etc_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
|
|
|
|
allow pppd_t pppd_etc_rw_t:file create_file_perms;
|
|
|
|
|
|
|
|
allow pppd_t pppd_lock_t:file create_file_perms;
|
2006-01-13 21:06:49 +00:00
|
|
|
files_filetrans_lock(pppd_t,pppd_lock_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
|
|
|
|
allow pppd_t pppd_log_t:file create_file_perms;
|
2006-01-13 21:06:49 +00:00
|
|
|
logging_filetrans_log(pppd_t,pppd_log_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
|
|
|
|
allow pppd_t pppd_tmp_t:dir create_dir_perms;
|
|
|
|
allow pppd_t pppd_tmp_t:file create_file_perms;
|
2006-01-13 21:06:49 +00:00
|
|
|
files_filetrans_tmp(pppd_t, pppd_tmp_t, { file dir })
|
2005-10-14 20:00:07 +00:00
|
|
|
|
|
|
|
allow pppd_t pppd_var_run_t:dir rw_dir_perms;
|
|
|
|
allow pppd_t pppd_var_run_t:file create_file_perms;
|
2006-01-13 21:06:49 +00:00
|
|
|
files_filetrans_pid(pppd_t,pppd_var_run_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
|
|
|
|
allow pppd_t pptp_t:process signal;
|
|
|
|
|
|
|
|
# for SSP
|
|
|
|
# Access secret files
|
|
|
|
allow pppd_t pppd_secret_t:file r_file_perms;
|
|
|
|
|
|
|
|
# Automatically label newly created files under /etc/ppp with this type
|
|
|
|
type_transition pppd_t pppd_etc_t:file pppd_etc_rw_t;
|
|
|
|
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(pppd_t)
|
2005-11-08 22:00:30 +00:00
|
|
|
kernel_read_system_state(pppd_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_net_sysctls(pppd_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
kernel_read_network_state(pppd_t)
|
|
|
|
kernel_load_module(pppd_t)
|
|
|
|
|
|
|
|
dev_read_urand(pppd_t)
|
|
|
|
dev_search_sysfs(pppd_t)
|
|
|
|
dev_read_sysfs(pppd_t)
|
|
|
|
|
|
|
|
corenet_tcp_sendrecv_all_if(pppd_t)
|
|
|
|
corenet_raw_sendrecv_all_if(pppd_t)
|
|
|
|
corenet_udp_sendrecv_all_if(pppd_t)
|
|
|
|
corenet_tcp_sendrecv_all_nodes(pppd_t)
|
|
|
|
corenet_raw_sendrecv_all_nodes(pppd_t)
|
|
|
|
corenet_udp_sendrecv_all_nodes(pppd_t)
|
|
|
|
corenet_tcp_sendrecv_all_ports(pppd_t)
|
|
|
|
corenet_udp_sendrecv_all_ports(pppd_t)
|
2005-12-06 19:59:50 +00:00
|
|
|
corenet_non_ipsec_sendrecv(pppd_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
corenet_tcp_bind_all_nodes(pppd_t)
|
|
|
|
corenet_udp_bind_all_nodes(pppd_t)
|
|
|
|
# Access /dev/ppp.
|
|
|
|
corenet_use_ppp_device(pppd_t)
|
|
|
|
|
|
|
|
fs_getattr_all_fs(pppd_t)
|
|
|
|
fs_search_auto_mountpoints(pppd_t)
|
|
|
|
|
2006-02-02 21:08:12 +00:00
|
|
|
term_use_unallocated_ttys(pppd_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
term_setattr_unallocated_ttys(pppd_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
term_ioctl_generic_ptys(pppd_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
# for pppoe
|
|
|
|
term_create_pty(pppd_t,pppd_devpts_t)
|
|
|
|
term_dontaudit_use_console(pppd_t)
|
|
|
|
|
|
|
|
# allow running ip-up and ip-down scripts and running chat.
|
|
|
|
corecmd_exec_bin(pppd_t)
|
|
|
|
corecmd_exec_sbin(pppd_t)
|
|
|
|
corecmd_exec_shell(pppd_t)
|
|
|
|
|
|
|
|
domain_use_wide_inherit_fd(pppd_t)
|
|
|
|
|
|
|
|
files_exec_etc_files(pppd_t)
|
|
|
|
files_read_etc_runtime_files(pppd_t)
|
|
|
|
# for scripts
|
|
|
|
files_read_etc_files(pppd_t)
|
|
|
|
|
2006-01-18 18:08:39 +00:00
|
|
|
init_read_utmp(pppd_t)
|
|
|
|
init_dontaudit_write_utmp(pppd_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
init_use_fd(pppd_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
init_use_script_ptys(pppd_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
|
|
|
|
libs_use_ld_so(pppd_t)
|
|
|
|
libs_use_shared_libs(pppd_t)
|
|
|
|
|
|
|
|
logging_send_syslog_msg(pppd_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(pppd_t)
|
|
|
|
|
|
|
|
sysnet_read_config(pppd_t)
|
|
|
|
sysnet_exec_ifconfig(pppd_t)
|
|
|
|
sysnet_manage_config(pppd_t)
|
|
|
|
|
|
|
|
userdom_dontaudit_use_unpriv_user_fd(pppd_t)
|
|
|
|
userdom_dontaudit_search_sysadm_home_dir(pppd_t)
|
|
|
|
# for ~/.ppprc - if it actually exists then you need some policy to read it
|
|
|
|
#allow pppd_t { sysadm_home_dir_t home_root_t user_home_dir_type }:dir search;
|
|
|
|
userdom_search_sysadm_home_dir(pppd_t)
|
|
|
|
userdom_search_unpriv_user_home_dirs(pppd_t)
|
|
|
|
|
|
|
|
ifdef(`targeted_policy', `
|
2006-02-02 21:08:12 +00:00
|
|
|
term_dontaudit_use_unallocated_ttys(pppd_t)
|
|
|
|
term_dontaudit_use_generic_ptys(pppd_t)
|
2006-01-31 19:21:01 +00:00
|
|
|
files_dontaudit_read_root_files(pppd_t)
|
2005-10-23 20:18:36 +00:00
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`postfix',`
|
2005-10-23 20:18:36 +00:00
|
|
|
gen_require(`
|
2005-10-26 21:03:19 +00:00
|
|
|
bool postfix_disable_trans;
|
2005-10-23 20:18:36 +00:00
|
|
|
')
|
|
|
|
|
2005-10-26 21:03:19 +00:00
|
|
|
if(!postfix_disable_trans) {
|
2005-10-23 20:18:36 +00:00
|
|
|
postfix_domtrans_master(pppd_t)
|
|
|
|
}
|
|
|
|
')
|
|
|
|
',`
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`postfix',`
|
2005-10-23 20:18:36 +00:00
|
|
|
postfix_domtrans_master(pppd_t)
|
|
|
|
')
|
2005-10-14 20:00:07 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`modutils',`
|
2005-11-07 20:09:28 +00:00
|
|
|
tunable_policy(`pppd_can_insmod && ! secure_mode_insmod',`
|
|
|
|
modutils_domtrans_insmod_uncond(pppd_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`mta',`
|
2005-10-25 00:00:50 +00:00
|
|
|
mta_send_mail(pppd_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nis',`
|
2005-10-14 20:00:07 +00:00
|
|
|
nis_use_ypbind(pppd_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nscd',`
|
2006-02-02 21:08:12 +00:00
|
|
|
nscd_socket_use(pppd_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`selinuxutil',`
|
2005-10-14 20:00:07 +00:00
|
|
|
seutil_sigchld_newrole(pppd_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`udev',`
|
2005-10-14 20:00:07 +00:00
|
|
|
udev_read_db(pppd_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# PPTP Local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
dontaudit pptp_t self:capability sys_tty_config;
|
|
|
|
allow pptp_t self:capability net_raw;
|
|
|
|
allow pptp_t self:fifo_file { read write };
|
|
|
|
allow pptp_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow pptp_t self:unix_stream_socket { connectto create_stream_socket_perms };
|
|
|
|
allow pptp_t self:rawip_socket create_socket_perms;
|
|
|
|
allow pptp_t self:tcp_socket create_socket_perms;
|
|
|
|
|
|
|
|
allow pptp_t pppd_etc_t:dir { getattr read search };
|
|
|
|
allow pptp_t pppd_etc_t:file { read getattr };
|
|
|
|
allow pptp_t pppd_etc_t:lnk_file { getattr read };
|
|
|
|
|
|
|
|
allow pptp_t pppd_etc_rw_t:dir { getattr read search };
|
|
|
|
allow pptp_t pppd_etc_rw_t:file { read getattr };
|
|
|
|
allow pptp_t pppd_etc_rw_t:lnk_file { getattr read };
|
|
|
|
can_exec(pptp_t, pppd_etc_rw_t)
|
|
|
|
|
|
|
|
# Allow pptp to append to pppd log files
|
|
|
|
allow pptp_t pppd_log_t:file append;
|
|
|
|
|
|
|
|
allow pptp_t pptp_log_t:file create_file_perms;
|
2006-01-13 21:06:49 +00:00
|
|
|
logging_filetrans_log(pptp_t,pptp_log_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
|
|
|
|
allow pptp_t pptp_var_run_t:file create_file_perms;
|
|
|
|
allow pptp_t pptp_var_run_t:dir rw_dir_perms;
|
|
|
|
allow pptp_t pptp_var_run_t:sock_file create_file_perms;
|
2006-01-13 21:06:49 +00:00
|
|
|
files_filetrans_pid(pptp_t,pptp_var_run_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
|
|
|
|
kernel_list_proc(pptp_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(pptp_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
kernel_read_proc_symlinks(pptp_t)
|
|
|
|
|
|
|
|
dev_read_sysfs(pptp_t)
|
|
|
|
|
|
|
|
corenet_tcp_sendrecv_all_if(pptp_t)
|
|
|
|
corenet_raw_sendrecv_all_if(pptp_t)
|
|
|
|
corenet_tcp_sendrecv_all_nodes(pptp_t)
|
|
|
|
corenet_raw_sendrecv_all_nodes(pptp_t)
|
|
|
|
corenet_tcp_sendrecv_all_ports(pptp_t)
|
2005-12-06 19:59:50 +00:00
|
|
|
corenet_non_ipsec_sendrecv(pptp_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
corenet_tcp_bind_all_nodes(pptp_t)
|
|
|
|
corenet_tcp_connect_generic_port(pptp_t)
|
|
|
|
corenet_tcp_connect_all_reserved_ports(pptp_t)
|
|
|
|
|
|
|
|
fs_getattr_all_fs(pptp_t)
|
|
|
|
fs_search_auto_mountpoints(pptp_t)
|
|
|
|
|
|
|
|
term_dontaudit_use_console(pptp_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
term_ioctl_generic_ptys(pptp_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
term_search_ptys(pptp_t)
|
|
|
|
term_use_ptmx(pptp_t)
|
|
|
|
|
|
|
|
domain_use_wide_inherit_fd(pptp_t)
|
|
|
|
|
|
|
|
init_use_fd(pptp_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
init_use_script_ptys(pptp_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
|
|
|
|
libs_use_ld_so(pptp_t)
|
|
|
|
libs_use_shared_libs(pptp_t)
|
|
|
|
|
|
|
|
logging_send_syslog_msg(pptp_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(pptp_t)
|
|
|
|
|
|
|
|
sysnet_read_config(pptp_t)
|
|
|
|
|
|
|
|
userdom_dontaudit_use_unpriv_user_fd(pptp_t)
|
|
|
|
userdom_dontaudit_search_sysadm_home_dir(pptp_t)
|
|
|
|
|
|
|
|
ifdef(`targeted_policy',`
|
2006-02-02 21:08:12 +00:00
|
|
|
term_dontaudit_use_unallocated_ttys(pptp_t)
|
|
|
|
term_dontaudit_use_generic_ptys(pptp_t)
|
2006-01-31 19:21:01 +00:00
|
|
|
files_dontaudit_read_root_files(pptp_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`hostname',`
|
2005-10-14 20:00:07 +00:00
|
|
|
hostname_exec(pptp_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nscd',`
|
2006-02-02 21:08:12 +00:00
|
|
|
nscd_socket_use(pptp_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`selinuxutil',`
|
2005-10-14 20:00:07 +00:00
|
|
|
seutil_sigchld_newrole(pptp_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`udev',`
|
2005-10-14 20:00:07 +00:00
|
|
|
udev_read_db(pptp_t)
|
|
|
|
')
|
|
|
|
|
2006-01-06 22:51:40 +00:00
|
|
|
optional_policy(`postfix',`
|
|
|
|
postfix_read_config(pppd_t)
|
2005-10-14 20:00:07 +00:00
|
|
|
')
|
2005-11-08 22:00:30 +00:00
|
|
|
|
2006-01-31 16:49:43 +00:00
|
|
|
# FIXME:
|
2005-11-08 22:00:30 +00:00
|
|
|
domain_auto_trans(pppd_t, pppd_script_exec_t, initrc_t)
|
|
|
|
allow pppd_t initrc_t:fd use;
|
|
|
|
allow initrc_t pppd_t:fd use;
|
|
|
|
allow initrc_t pppd_t:fifo_file rw_file_perms;
|
|
|
|
allow initrc_t pppd_t:process sigchld;
|