selinux-policy/policy/modules/services/ppp.te

331 lines
7.9 KiB
Plaintext
Raw Normal View History

2005-10-14 20:00:07 +00:00
2006-10-18 19:25:27 +00:00
policy_module(ppp,1.3.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
#
allow pppd_t self:capability { net_admin setuid setgid fsetid fowner net_raw dac_override };
2006-05-30 19:46:34 +00:00
dontaudit pppd_t self:capability sys_tty_config;
allow pppd_t self:process signal;
2006-12-12 20:08:08 +00:00
allow pppd_t self:fifo_file rw_fifo_file_perms;
2005-10-14 20:00:07 +00:00
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 rw_netlink_socket_perms;
2005-10-14 20:00:07 +00:00
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;
2006-12-12 20:08:08 +00:00
domtrans_pattern(pppd_t, pptp_exec_t, pptp_t)
2005-10-14 20:00:07 +00:00
2006-12-12 20:08:08 +00:00
allow pppd_t pppd_devpts_t:chr_file { rw_chr_file_perms setattr };
2005-10-14 20:00:07 +00:00
allow pppd_t pppd_etc_t:dir rw_dir_perms;
2006-12-12 20:08:08 +00:00
allow pppd_t pppd_etc_t:file read_file_perms;
2005-10-14 20:00:07 +00:00
allow pppd_t pppd_etc_t:lnk_file { getattr read };
2006-12-12 20:08:08 +00:00
manage_files_pattern(pppd_t,pppd_etc_rw_t,pppd_etc_rw_t)
# Automatically label newly created files under /etc/ppp with this type
2006-12-12 20:08:08 +00:00
filetrans_pattern(pppd_t,pppd_etc_t,pppd_etc_rw_t,file)
2005-10-14 20:00:07 +00:00
2006-12-12 20:08:08 +00:00
allow pppd_t pppd_lock_t:file manage_file_perms;
files_lock_filetrans(pppd_t,pppd_lock_t,file)
2005-10-14 20:00:07 +00:00
2006-12-12 20:08:08 +00:00
allow pppd_t pppd_log_t:file manage_file_perms;
logging_log_filetrans(pppd_t,pppd_log_t,file)
2005-10-14 20:00:07 +00:00
2006-12-12 20:08:08 +00:00
manage_dirs_pattern(pppd_t,pppd_tmp_t,pppd_tmp_t)
manage_files_pattern(pppd_t,pppd_tmp_t,pppd_tmp_t)
2006-02-21 18:40:44 +00:00
files_tmp_filetrans(pppd_t, pppd_tmp_t, { file dir })
2005-10-14 20:00:07 +00:00
2006-12-12 20:08:08 +00:00
manage_files_pattern(pppd_t,pppd_var_run_t,pppd_var_run_t)
files_pid_filetrans(pppd_t,pppd_var_run_t,file)
2005-10-14 20:00:07 +00:00
allow pppd_t pptp_t:process signal;
# for SSP
# Access secret files
2006-12-12 20:08:08 +00:00
allow pppd_t pppd_secret_t:file read_file_perms;
2005-10-14 20:00:07 +00:00
kernel_read_kernel_sysctls(pppd_t)
2005-11-08 22:00:30 +00:00
kernel_read_system_state(pppd_t)
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)
2006-05-30 19:46:34 +00:00
corenet_non_ipsec_sendrecv(pppd_t)
2005-10-14 20:00:07 +00:00
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)
# Access /dev/ppp.
2006-02-16 21:33:18 +00:00
corenet_rw_ppp_dev(pppd_t)
2005-10-14 20:00:07 +00:00
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)
2006-02-20 21:33:25 +00:00
domain_use_interactive_fds(pppd_t)
2005-10-14 20:00:07 +00:00
files_exec_etc_files(pppd_t)
files_manage_etc_runtime_files(pppd_t)
files_etc_filetrans_etc_runtime(pppd_t, { dir file })
files_dontaudit_write_etc_files(pppd_t)
2005-10-14 20:00:07 +00:00
# for scripts
files_read_etc_files(pppd_t)
init_read_utmp(pppd_t)
init_dontaudit_write_utmp(pppd_t)
init_use_fds(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)
2006-02-20 21:33:25 +00:00
userdom_dontaudit_use_unpriv_user_fds(pppd_t)
2006-02-21 18:40:44 +00:00
userdom_dontaudit_search_sysadm_home_dirs(pppd_t)
2005-10-14 20:00:07 +00:00
# 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;
2006-02-21 18:40:44 +00:00
userdom_search_sysadm_home_dirs(pppd_t)
2006-02-20 21:33:25 +00:00
userdom_search_unpriv_users_home_dirs(pppd_t)
2005-10-14 20:00:07 +00:00
ppp_exec(pppd_t)
2005-10-14 20:00:07 +00:00
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)
files_dontaudit_read_root_files(pppd_t)
2005-10-23 20:18:36 +00:00
optional_policy(`
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)
}
')
',`
optional_policy(`
2005-10-23 20:18:36 +00:00
postfix_domtrans_master(pppd_t)
')
2005-10-14 20:00:07 +00:00
')
2006-04-25 17:50:31 +00:00
optional_policy(`
ddclient_domtrans(pppd_t)
')
optional_policy(`
tunable_policy(`pppd_can_insmod && ! secure_mode_insmod',`
modutils_domtrans_insmod_uncond(pppd_t)
2005-10-14 20:00:07 +00:00
')
')
optional_policy(`
2005-10-25 00:00:50 +00:00
mta_send_mail(pppd_t)
')
optional_policy(`
2005-10-14 20:00:07 +00:00
nis_use_ypbind(pppd_t)
')
optional_policy(`
2006-02-02 21:08:12 +00:00
nscd_socket_use(pppd_t)
2005-10-14 20:00:07 +00:00
')
optional_policy(`
2005-10-14 20:00:07 +00:00
seutil_sigchld_newrole(pppd_t)
')
optional_policy(`
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;
2006-12-12 20:08:08 +00:00
allow pptp_t pptp_log_t:file manage_file_perms;
logging_log_filetrans(pptp_t,pptp_log_t,file)
2005-10-14 20:00:07 +00:00
2006-12-12 20:08:08 +00:00
manage_files_pattern(pptp_t,pptp_var_run_t,pptp_var_run_t)
manage_sock_files_pattern(pptp_t,pptp_var_run_t,pptp_var_run_t)
files_pid_filetrans(pptp_t,pptp_var_run_t,file)
2005-10-14 20:00:07 +00:00
kernel_list_proc(pptp_t)
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)
2006-05-30 19:46:34 +00:00
corenet_non_ipsec_sendrecv(pptp_t)
2005-10-14 20:00:07 +00:00
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)
corenet_tcp_bind_all_nodes(pptp_t)
corenet_tcp_connect_generic_port(pptp_t)
corenet_tcp_connect_all_reserved_ports(pptp_t)
2006-05-30 19:46:34 +00:00
corenet_sendrecv_generic_client_packets(pptp_t)
2005-10-14 20:00:07 +00:00
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)
2006-02-20 21:33:25 +00:00
domain_use_interactive_fds(pptp_t)
2005-10-14 20:00:07 +00:00
init_use_fds(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)
2006-02-20 21:33:25 +00:00
userdom_dontaudit_use_unpriv_user_fds(pptp_t)
2006-02-21 18:40:44 +00:00
userdom_dontaudit_search_sysadm_home_dirs(pptp_t)
2005-10-14 20:00:07 +00:00
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)
files_dontaudit_read_root_files(pptp_t)
2005-10-14 20:00:07 +00:00
')
optional_policy(`
consoletype_exec(pppd_t)
')
optional_policy(`
2005-10-14 20:00:07 +00:00
hostname_exec(pptp_t)
')
optional_policy(`
2006-02-02 21:08:12 +00:00
nscd_socket_use(pptp_t)
2005-10-14 20:00:07 +00:00
')
optional_policy(`
2005-10-14 20:00:07 +00:00
seutil_sigchld_newrole(pptp_t)
')
optional_policy(`
2005-10-14 20:00:07 +00:00
udev_read_db(pptp_t)
')
optional_policy(`
2006-01-06 22:51:40 +00:00
postfix_read_config(pppd_t)
2005-10-14 20:00:07 +00:00
')
2005-11-08 22:00:30 +00:00
# FIXME:
2006-12-12 20:08:08 +00:00
domtrans_pattern(pppd_t, pppd_script_exec_t, initrc_t)