|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
f7925f |
policy_module(openvpn,1.5.0)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Declarations
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
72f82c |
## <desc>
|
|
Chris PeBenito |
72f82c |
##
|
|
Chris PeBenito |
72f82c |
## Allow openvpn to read home directories
|
|
Chris PeBenito |
72f82c |
##
|
|
Chris PeBenito |
72f82c |
## </desc>
|
|
Chris PeBenito |
72f82c |
gen_tunable(openvpn_enable_homedirs,false)
|
|
Chris PeBenito |
72f82c |
|
|
Chris PeBenito |
17de1b |
# main openvpn domain
|
|
Chris PeBenito |
17de1b |
type openvpn_t;
|
|
Chris PeBenito |
17de1b |
type openvpn_exec_t;
|
|
Chris PeBenito |
17de1b |
init_daemon_domain(openvpn_t, openvpn_exec_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# configuration files
|
|
Chris PeBenito |
17de1b |
type openvpn_etc_t;
|
|
Chris PeBenito |
17de1b |
files_type(openvpn_etc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# log files
|
|
Chris PeBenito |
17de1b |
type openvpn_var_log_t;
|
|
Chris PeBenito |
17de1b |
logging_log_file(openvpn_var_log_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# pid files
|
|
Chris PeBenito |
17de1b |
type openvpn_var_run_t;
|
|
Chris PeBenito |
17de1b |
files_pid_file(openvpn_var_run_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# openvpn local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
72f82c |
allow openvpn_t self:capability { dac_read_search dac_override net_bind_service net_admin setgid setuid sys_tty_config };
|
|
Chris PeBenito |
72f82c |
allow openvpn_t self:process { signal getsched };
|
|
Chris PeBenito |
72f82c |
|
|
Chris PeBenito |
17de1b |
allow openvpn_t self:unix_dgram_socket { create_socket_perms sendto };
|
|
Chris PeBenito |
17de1b |
allow openvpn_t self:unix_stream_socket { create_stream_socket_perms connectto };
|
|
Chris PeBenito |
17de1b |
allow openvpn_t self:udp_socket create_socket_perms;
|
|
Chris PeBenito |
6b19be |
allow openvpn_t self:tcp_socket server_stream_socket_perms;
|
|
Chris PeBenito |
a5e213 |
allow openvpn_t self:netlink_route_socket rw_netlink_socket_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
allow openvpn_t openvpn_etc_t:dir list_dir_perms;
|
|
Chris PeBenito |
c0868a |
read_files_pattern(openvpn_t,openvpn_etc_t,openvpn_etc_t)
|
|
Chris PeBenito |
c0868a |
read_lnk_files_pattern(openvpn_t,openvpn_etc_t,openvpn_etc_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
c0868a |
allow openvpn_t openvpn_var_log_t:file manage_file_perms;
|
|
Chris PeBenito |
17de1b |
logging_log_filetrans(openvpn_t,openvpn_var_log_t,file)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
72f82c |
manage_files_pattern(openvpn_t, openvpn_var_run_t, openvpn_var_run_t)
|
|
Chris PeBenito |
72f82c |
files_pid_filetrans(openvpn_t, openvpn_var_run_t, { file dir })
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_kernel_sysctls(openvpn_t)
|
|
Chris PeBenito |
17de1b |
kernel_read_net_sysctls(openvpn_t)
|
|
Chris PeBenito |
17de1b |
kernel_read_network_state(openvpn_t)
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state(openvpn_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
corecmd_exec_bin(openvpn_t)
|
|
Chris PeBenito |
17de1b |
corecmd_exec_shell(openvpn_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
190066 |
corenet_all_recvfrom_unlabeled(openvpn_t)
|
|
Chris PeBenito |
190066 |
corenet_all_recvfrom_netlabel(openvpn_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_if(openvpn_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_if(openvpn_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_generic_node(openvpn_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_generic_node(openvpn_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_ports(openvpn_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_ports(openvpn_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_bind_all_nodes(openvpn_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_bind_all_nodes(openvpn_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_bind_openvpn_port(openvpn_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_bind_openvpn_port(openvpn_t)
|
|
Chris PeBenito |
17de1b |
corenet_sendrecv_openvpn_server_packets(openvpn_t)
|
|
Chris PeBenito |
17de1b |
corenet_rw_tun_tap_dev(openvpn_t)
|
|
Chris PeBenito |
72f82c |
corenet_tcp_connect_openvpn_port(openvpn_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
465510 |
dev_search_sysfs(openvpn_t)
|
|
Chris PeBenito |
17de1b |
dev_read_rand(openvpn_t)
|
|
Chris PeBenito |
17de1b |
dev_read_urand(openvpn_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_read_etc_files(openvpn_t)
|
|
Chris PeBenito |
17de1b |
files_read_etc_runtime_files(openvpn_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so(openvpn_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs(openvpn_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(openvpn_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(openvpn_t)
|
|
Chris PeBenito |
72f82c |
miscfiles_read_certs(openvpn_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
465510 |
sysnet_dns_name_resolve(openvpn_t)
|
|
Chris PeBenito |
17de1b |
sysnet_exec_ifconfig(openvpn_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
72f82c |
tunable_policy(`openvpn_enable_homedirs',`
|
|
Chris PeBenito |
72f82c |
userdom_read_unpriv_users_home_content_files(openvpn_t)
|
|
Chris PeBenito |
72f82c |
')
|
|
Chris PeBenito |
72f82c |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
daemontools_service_domain(openvpn_t,openvpn_exec_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
72f82c |
|
|
Chris PeBenito |
72f82c |
optional_policy(`
|
|
Chris PeBenito |
72f82c |
dbus_system_bus_client_template(openvpn,openvpn_t)
|
|
Chris PeBenito |
72f82c |
dbus_connect_system_bus(openvpn_t)
|
|
Chris PeBenito |
72f82c |
|
|
Chris PeBenito |
72f82c |
networkmanager_dbus_chat(openvpn_t)
|
|
Chris PeBenito |
72f82c |
')
|