selinux-refpolicy/policy/modules/services/l2tp.te
Stephen Smalley 161bda392e access_vectors: Remove unused permissions
Remove unused permission definitions from SELinux.
Many of these were only ever used in pre-mainline
versions of SELinux, prior to Linux 2.6.0.  Some of them
were used in the legacy network or compat_net=1 checks
that were disabled by default in Linux 2.6.18 and
fully removed in Linux 2.6.30.

The corresponding classmap declarations were removed from the
mainline kernel in:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=42a9699a9fa179c0054ea3cf5ad3cc67104a6162

Permissions never used in mainline Linux:
file swapon
filesystem transition
tcp_socket { connectto newconn acceptfrom }
node enforce_dest
unix_stream_socket { newconn acceptfrom }

Legacy network checks, removed in 2.6.30:
socket { recv_msg send_msg }
node { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send dccp_recv dccp_send }
netif { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send dccp_recv dccp_send }

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2020-01-14 13:41:50 -05:00

93 lines
2.4 KiB
Plaintext

policy_module(l2tp, 1.4.1)
########################################
#
# Declarations
#
type l2tpd_t;
type l2tpd_exec_t;
init_daemon_domain(l2tpd_t, l2tpd_exec_t)
type l2tpd_initrc_exec_t;
init_script_file(l2tpd_initrc_exec_t)
type l2tp_conf_t;
files_config_file(l2tp_conf_t)
type l2tpd_runtime_t alias l2tpd_var_run_t;
files_pid_file(l2tpd_runtime_t)
type l2tpd_tmp_t;
files_tmp_file(l2tpd_tmp_t)
########################################
#
# Local policy
#
allow l2tpd_t self:capability net_admin;
allow l2tpd_t self:process signal;
allow l2tpd_t self:fifo_file rw_fifo_file_perms;
allow l2tpd_t self:netlink_socket create_socket_perms;
allow l2tpd_t self:rawip_socket create_socket_perms;
allow l2tpd_t self:socket create_socket_perms;
allow l2tpd_t self:tcp_socket { accept listen };
allow l2tpd_t self:unix_dgram_socket sendto;
allow l2tpd_t self:unix_stream_socket { accept listen };
read_files_pattern(l2tpd_t, l2tp_conf_t, l2tp_conf_t)
manage_dirs_pattern(l2tpd_t, l2tpd_runtime_t, l2tpd_runtime_t)
manage_files_pattern(l2tpd_t, l2tpd_runtime_t, l2tpd_runtime_t)
manage_sock_files_pattern(l2tpd_t, l2tpd_runtime_t, l2tpd_runtime_t)
manage_fifo_files_pattern(l2tpd_t, l2tpd_runtime_t, l2tpd_runtime_t)
files_pid_filetrans(l2tpd_t, l2tpd_runtime_t, { dir file sock_file })
manage_sock_files_pattern(l2tpd_t, l2tpd_tmp_t, l2tpd_tmp_t)
files_tmp_filetrans(l2tpd_t, l2tpd_tmp_t, sock_file)
corenet_all_recvfrom_unlabeled(l2tpd_t)
corenet_all_recvfrom_netlabel(l2tpd_t)
corenet_raw_sendrecv_generic_if(l2tpd_t)
corenet_tcp_sendrecv_generic_if(l2tpd_t)
corenet_udp_sendrecv_generic_if(l2tpd_t)
corenet_raw_bind_generic_node(l2tpd_t)
corenet_tcp_bind_generic_node(l2tpd_t)
corenet_udp_bind_generic_node(l2tpd_t)
corenet_raw_sendrecv_generic_node(l2tpd_t)
corenet_tcp_sendrecv_generic_node(l2tpd_t)
corenet_udp_sendrecv_generic_node(l2tpd_t)
corenet_sendrecv_all_server_packets(l2tpd_t)
corenet_tcp_bind_all_rpc_ports(l2tpd_t)
corenet_udp_bind_all_rpc_ports(l2tpd_t)
corenet_udp_bind_l2tp_port(l2tpd_t)
kernel_read_network_state(l2tpd_t)
kernel_read_system_state(l2tpd_t)
kernel_request_load_module(l2tpd_t)
corecmd_exec_bin(l2tpd_t)
dev_read_urand(l2tpd_t)
files_read_etc_files(l2tpd_t)
term_setattr_generic_ptys(l2tpd_t)
term_use_generic_ptys(l2tpd_t)
term_use_ptmx(l2tpd_t)
logging_send_syslog_msg(l2tpd_t)
miscfiles_read_localization(l2tpd_t)
sysnet_dns_name_resolve(l2tpd_t)
optional_policy(`
ppp_domtrans(l2tpd_t)
ppp_signal(l2tpd_t)
ppp_kill(l2tpd_t)
')