1900668638
The latest revision of the labeled policy patches which enable both labeled and unlabeled policy support for NetLabel. This revision takes into account Chris' feedback from the first version and reduces the number of interface calls in each domain down to two at present: one for unlabeled access, one for NetLabel access. The older, transport layer specific interfaces, are still present for use by third-party modules but are not used in the default policy modules. trunk: Use netmsg initial SID for MLS-only Netlabel packets, from Paul Moore. This patch changes the policy to use the netmsg initial SID as the "base" SID/context for NetLabel packets which only have MLS security attributes. Currently we use the unlabeled initial SID which makes it very difficult to distinquish between actual unlabeled packets and those packets which have MLS security attributes.
123 lines
3.0 KiB
Plaintext
123 lines
3.0 KiB
Plaintext
|
|
policy_module(vpn,1.4.1)
|
|
|
|
########################################
|
|
#
|
|
# Declarations
|
|
#
|
|
|
|
type vpnc_t;
|
|
domain_type(vpnc_t)
|
|
|
|
type vpnc_exec_t;
|
|
domain_entry_file(vpnc_t,vpnc_exec_t)
|
|
role system_r types vpnc_t;
|
|
|
|
type vpnc_tmp_t;
|
|
files_tmp_file(vpnc_tmp_t)
|
|
|
|
type vpnc_var_run_t;
|
|
files_pid_file(vpnc_var_run_t)
|
|
|
|
########################################
|
|
#
|
|
# Local policy
|
|
#
|
|
|
|
allow vpnc_t self:capability { net_admin ipc_lock net_raw };
|
|
allow vpnc_t self:process getsched;
|
|
allow vpnc_t self:fifo_file { getattr ioctl read write };
|
|
allow vpnc_t self:netlink_route_socket rw_netlink_socket_perms;
|
|
allow vpnc_t self:tcp_socket create_stream_socket_perms;
|
|
allow vpnc_t self:udp_socket create_socket_perms;
|
|
allow vpnc_t self:rawip_socket create_socket_perms;
|
|
allow vpnc_t self:unix_dgram_socket create_socket_perms;
|
|
allow vpnc_t self:unix_stream_socket create_socket_perms;
|
|
# cjp: this needs to be fixed
|
|
allow vpnc_t self:socket create_socket_perms;
|
|
|
|
manage_dirs_pattern(vpnc_t,vpnc_tmp_t,vpnc_tmp_t)
|
|
manage_files_pattern(vpnc_t,vpnc_tmp_t,vpnc_tmp_t)
|
|
files_tmp_filetrans(vpnc_t, vpnc_tmp_t, { file dir })
|
|
|
|
manage_files_pattern(vpnc_t,vpnc_var_run_t,vpnc_var_run_t)
|
|
files_pid_filetrans(vpnc_t,vpnc_var_run_t,file)
|
|
|
|
kernel_read_system_state(vpnc_t)
|
|
kernel_read_network_state(vpnc_t)
|
|
kernel_read_kernel_sysctls(vpnc_t)
|
|
kernel_rw_net_sysctls(vpnc_t)
|
|
|
|
corenet_all_recvfrom_unlabeled(vpnc_t)
|
|
corenet_all_recvfrom_netlabel(vpnc_t)
|
|
corenet_tcp_sendrecv_all_if(vpnc_t)
|
|
corenet_udp_sendrecv_all_if(vpnc_t)
|
|
corenet_raw_sendrecv_all_if(vpnc_t)
|
|
corenet_tcp_sendrecv_all_nodes(vpnc_t)
|
|
corenet_udp_sendrecv_all_nodes(vpnc_t)
|
|
corenet_raw_sendrecv_all_nodes(vpnc_t)
|
|
corenet_tcp_sendrecv_all_ports(vpnc_t)
|
|
corenet_udp_sendrecv_all_ports(vpnc_t)
|
|
corenet_udp_bind_all_nodes(vpnc_t)
|
|
corenet_udp_bind_generic_port(vpnc_t)
|
|
corenet_udp_bind_isakmp_port(vpnc_t)
|
|
corenet_tcp_connect_all_ports(vpnc_t)
|
|
corenet_sendrecv_all_client_packets(vpnc_t)
|
|
corenet_sendrecv_isakmp_server_packets(vpnc_t)
|
|
corenet_sendrecv_generic_server_packets(vpnc_t)
|
|
corenet_rw_tun_tap_dev(vpnc_t)
|
|
|
|
dev_read_rand(vpnc_t)
|
|
dev_read_urand(vpnc_t)
|
|
dev_read_sysfs(vpnc_t)
|
|
|
|
fs_getattr_xattr_fs(vpnc_t)
|
|
fs_getattr_tmpfs(vpnc_t)
|
|
|
|
term_use_all_user_ptys(vpnc_t)
|
|
term_use_all_user_ttys(vpnc_t)
|
|
|
|
corecmd_exec_all_executables(vpnc_t)
|
|
|
|
files_exec_etc_files(vpnc_t)
|
|
files_read_etc_runtime_files(vpnc_t)
|
|
files_read_etc_files(vpnc_t)
|
|
files_dontaudit_search_home(vpnc_t)
|
|
|
|
libs_exec_ld_so(vpnc_t)
|
|
libs_exec_lib_files(vpnc_t)
|
|
libs_use_ld_so(vpnc_t)
|
|
libs_use_shared_libs(vpnc_t)
|
|
|
|
locallogin_use_fds(vpnc_t)
|
|
|
|
logging_send_syslog_msg(vpnc_t)
|
|
|
|
miscfiles_read_localization(vpnc_t)
|
|
|
|
seutil_dontaudit_search_config(vpnc_t)
|
|
seutil_use_newrole_fds(vpnc_t)
|
|
|
|
sysnet_exec_ifconfig(vpnc_t)
|
|
sysnet_etc_filetrans_config(vpnc_t)
|
|
sysnet_manage_config(vpnc_t)
|
|
|
|
userdom_use_all_users_fds(vpnc_t)
|
|
userdom_dontaudit_search_all_users_home_content(vpnc_t)
|
|
|
|
optional_policy(`
|
|
dbus_system_bus_client_template(vpnc,vpnc_t)
|
|
dbus_send_system_bus(vpnc_t)
|
|
optional_policy(`
|
|
networkmanager_dbus_chat(vpnc_t)
|
|
')
|
|
')
|
|
|
|
optional_policy(`
|
|
nis_use_ypbind(vpnc_t)
|
|
')
|
|
|
|
optional_policy(`
|
|
nscd_socket_use(vpnc_t)
|
|
')
|