2022-01-06 13:55:54 +00:00
|
|
|
policy_module(stunnel)
|
2018-06-23 13:00:56 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
|
|
|
type stunnel_t;
|
|
|
|
type stunnel_exec_t;
|
|
|
|
init_daemon_domain(stunnel_t, stunnel_exec_t)
|
|
|
|
|
|
|
|
type stunnel_etc_t;
|
|
|
|
files_config_file(stunnel_etc_t)
|
|
|
|
|
2019-09-08 20:55:02 +00:00
|
|
|
type stunnel_runtime_t alias stunnel_var_run_t;
|
2020-06-27 21:11:48 +00:00
|
|
|
files_runtime_file(stunnel_runtime_t)
|
2018-06-23 13:00:56 +00:00
|
|
|
|
2021-01-26 23:05:56 +00:00
|
|
|
type stunnel_log_t;
|
|
|
|
logging_log_file(stunnel_log_t)
|
|
|
|
|
2019-09-11 00:05:46 +00:00
|
|
|
type stunnel_tmp_t;
|
|
|
|
files_tmp_file(stunnel_tmp_t)
|
|
|
|
|
2018-06-23 13:00:56 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow stunnel_t self:capability { setgid setuid sys_chroot };
|
|
|
|
dontaudit stunnel_t self:capability sys_tty_config;
|
|
|
|
allow stunnel_t self:process signal_perms;
|
|
|
|
allow stunnel_t self:fifo_file rw_fifo_file_perms;
|
|
|
|
allow stunnel_t self:tcp_socket { accept listen };
|
|
|
|
allow stunnel_t self:netlink_tcpdiag_socket r_netlink_socket_perms;
|
|
|
|
|
|
|
|
allow stunnel_t stunnel_etc_t:dir list_dir_perms;
|
|
|
|
allow stunnel_t stunnel_etc_t:file read_file_perms;
|
|
|
|
allow stunnel_t stunnel_etc_t:lnk_file read_lnk_file_perms;
|
|
|
|
|
|
|
|
manage_dirs_pattern(stunnel_t, stunnel_tmp_t, stunnel_tmp_t)
|
|
|
|
manage_files_pattern(stunnel_t, stunnel_tmp_t, stunnel_tmp_t)
|
|
|
|
files_tmp_filetrans(stunnel_t, stunnel_tmp_t, { file dir })
|
|
|
|
|
2019-09-08 20:55:02 +00:00
|
|
|
manage_dirs_pattern(stunnel_t, stunnel_runtime_t, stunnel_runtime_t)
|
|
|
|
manage_files_pattern(stunnel_t, stunnel_runtime_t, stunnel_runtime_t)
|
2020-06-27 21:11:48 +00:00
|
|
|
files_runtime_filetrans(stunnel_t, stunnel_runtime_t, { dir file })
|
2018-06-23 13:00:56 +00:00
|
|
|
|
2021-01-26 23:05:56 +00:00
|
|
|
manage_dirs_pattern(stunnel_t, stunnel_log_t, stunnel_log_t)
|
|
|
|
create_files_pattern(stunnel_t, stunnel_log_t, stunnel_log_t)
|
|
|
|
append_files_pattern(stunnel_t, stunnel_log_t, stunnel_log_t)
|
|
|
|
logging_log_filetrans(stunnel_t, stunnel_log_t, { dir file })
|
|
|
|
|
2018-06-23 13:00:56 +00:00
|
|
|
kernel_read_kernel_sysctls(stunnel_t)
|
|
|
|
kernel_read_system_state(stunnel_t)
|
|
|
|
kernel_read_network_state(stunnel_t)
|
|
|
|
|
|
|
|
corecmd_exec_bin(stunnel_t)
|
|
|
|
|
|
|
|
corenet_all_recvfrom_netlabel(stunnel_t)
|
|
|
|
corenet_tcp_sendrecv_generic_if(stunnel_t)
|
|
|
|
corenet_tcp_sendrecv_generic_node(stunnel_t)
|
|
|
|
corenet_tcp_bind_all_ports(stunnel_t)
|
|
|
|
corenet_tcp_bind_generic_node(stunnel_t)
|
|
|
|
|
|
|
|
corenet_sendrecv_all_client_packets(stunnel_t)
|
|
|
|
corenet_tcp_connect_all_ports(stunnel_t)
|
|
|
|
|
|
|
|
dev_read_sysfs(stunnel_t)
|
|
|
|
dev_read_urand(stunnel_t)
|
|
|
|
|
|
|
|
domain_use_interactive_fds(stunnel_t)
|
|
|
|
|
|
|
|
files_read_etc_runtime_files(stunnel_t)
|
|
|
|
files_search_home(stunnel_t)
|
|
|
|
|
|
|
|
fs_getattr_all_fs(stunnel_t)
|
|
|
|
fs_search_auto_mountpoints(stunnel_t)
|
|
|
|
|
|
|
|
auth_use_nsswitch(stunnel_t)
|
|
|
|
|
|
|
|
logging_send_syslog_msg(stunnel_t)
|
|
|
|
|
|
|
|
miscfiles_read_generic_certs(stunnel_t)
|
|
|
|
miscfiles_read_localization(stunnel_t)
|
|
|
|
miscfiles_read_generic_tls_privkey(stunnel_t)
|
|
|
|
|
|
|
|
userdom_dontaudit_use_unpriv_user_fds(stunnel_t)
|
|
|
|
userdom_dontaudit_search_user_home_dirs(stunnel_t)
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
daemontools_service_domain(stunnel_t, stunnel_exec_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
inetd_tcp_service_domain(stunnel_t, stunnel_exec_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
kerberos_use(stunnel_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
seutil_sigchld_newrole(stunnel_t)
|
|
|
|
')
|
|
|
|
|