|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
123a99 |
policy_module(openvpn,1.0.2)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
########################################
|
|
Chris PeBenito |
2ba3de |
#
|
|
Chris PeBenito |
2ba3de |
# Declarations
|
|
Chris PeBenito |
2ba3de |
#
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
# main openvpn domain
|
|
Chris PeBenito |
2ba3de |
type openvpn_t;
|
|
Chris PeBenito |
2ba3de |
type openvpn_exec_t;
|
|
Chris PeBenito |
2ba3de |
init_daemon_domain(openvpn_t, openvpn_exec_t)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
# configuration files
|
|
Chris PeBenito |
2ba3de |
type openvpn_etc_t;
|
|
Chris PeBenito |
2ba3de |
files_type(openvpn_etc_t)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
# log files
|
|
Chris PeBenito |
2ba3de |
type openvpn_var_log_t;
|
|
Chris PeBenito |
2ba3de |
logging_log_file(openvpn_var_log_t)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
# pid files
|
|
Chris PeBenito |
2ba3de |
type openvpn_var_run_t;
|
|
Chris PeBenito |
2ba3de |
files_pid_file(openvpn_var_run_t)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
########################################
|
|
Chris PeBenito |
2ba3de |
#
|
|
Chris PeBenito |
2ba3de |
# openvpn local policy
|
|
Chris PeBenito |
2ba3de |
#
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
allow openvpn_t self:capability { net_admin setgid setuid };
|
|
Chris PeBenito |
2ba3de |
allow openvpn_t self:unix_dgram_socket { create_socket_perms sendto };
|
|
Chris PeBenito |
2ba3de |
allow openvpn_t self:unix_stream_socket { create_stream_socket_perms connectto };
|
|
Chris PeBenito |
2ba3de |
allow openvpn_t self:udp_socket create_socket_perms;
|
|
Chris PeBenito |
2ba3de |
allow openvpn_t self:tcp_socket create_socket_perms;
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
allow openvpn_t openvpn_etc_t:dir r_dir_perms;
|
|
Chris PeBenito |
2ba3de |
allow openvpn_t openvpn_etc_t:file r_file_perms;
|
|
Chris PeBenito |
2ba3de |
allow openvpn_t openvpn_etc_t:lnk_file { getattr read };
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
allow openvpn_t openvpn_var_log_t:file create_file_perms;
|
|
Chris PeBenito |
2ba3de |
logging_log_filetrans(openvpn_t,openvpn_var_log_t,file)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
allow openvpn_t openvpn_var_run_t:file create_file_perms;
|
|
Chris PeBenito |
2ba3de |
files_pid_filetrans(openvpn_t, openvpn_var_run_t, file)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
123a99 |
kernel_read_kernel_sysctls(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
kernel_read_net_sysctls(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
kernel_read_network_state(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
kernel_read_system_state(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
corecmd_exec_bin(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
corecmd_exec_sbin(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
corecmd_exec_shell(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
corenet_non_ipsec_sendrecv(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
corenet_tcp_sendrecv_all_if(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
corenet_udp_sendrecv_all_if(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
corenet_tcp_sendrecv_generic_node(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
corenet_udp_sendrecv_generic_node(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
corenet_tcp_sendrecv_all_ports(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
corenet_udp_sendrecv_all_ports(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
corenet_tcp_bind_all_nodes(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
corenet_udp_bind_all_nodes(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
corenet_tcp_bind_openvpn_port(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
corenet_udp_bind_openvpn_port(openvpn_t)
|
|
Chris PeBenito |
141cff |
corenet_sendrecv_openvpn_server_packets(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
corenet_rw_tun_tap_dev(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
dev_read_rand(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
dev_read_urand(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
files_read_etc_files(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
files_read_etc_runtime_files(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
libs_use_ld_so(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
libs_use_shared_libs(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
logging_send_syslog_msg(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
miscfiles_read_localization(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
2ba3de |
sysnet_exec_ifconfig(openvpn_t)
|
|
Chris PeBenito |
2ba3de |
|
|
Chris PeBenito |
123a99 |
ifdef(`targeted_policy',`
|
|
Chris PeBenito |
123a99 |
term_dontaudit_use_generic_ptys(openvpn_t)
|
|
Chris PeBenito |
123a99 |
')
|
|
Chris PeBenito |
123a99 |
|
|
Chris PeBenito |
2ba3de |
optional_policy(`
|
|
Chris PeBenito |
2ba3de |
daemontools_service_domain(openvpn_t,openvpn_exec_t)
|
|
Chris PeBenito |
2ba3de |
')
|