## policy for sslh
########################################
##
## Execute sslh in the sslh domain.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`sslh_domtrans',`
gen_require(`
type sslh_t, sslh_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, sslh_exec_t, sslh_t)
')
#######################################
##
## Execute tor server in the tor domain.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`sslh_systemctl',`
gen_require(`
type sslh_t;
type sslh_unit_file_t;
')
systemd_exec_systemctl($1)
init_reload_services($1)
allow $1 sslh_unit_file_t:file read_file_perms;
allow $1 sslh_unit_file_t:service manage_service_perms;
ps_process_pattern($1, sslh_t)
')
########################################
##
## Permit the reading of sslh config files
##
##
##
## Domain allowed to access.
##
##
#
interface(`sslh_read_config',`
gen_require(`
type sslh_config_t;
')
files_search_etc($1)
allow $1 sslh_config_t:dir list_dir_perms;
allow $1 sslh_config_t:file read_file_perms;
allow $1 sslh_config_t:lnk_file read_lnk_file_perms;
')
########################################
##
## Permit the creation and writing of sslh config files
##
##
##
## Domain allowed to configure.
##
##
#
interface(`sslh_write_config',`
gen_require(`
type sslh_config_t;
')
files_search_etc($1)
allow $1 sslh_config_t:dir rw_dir_perms;
allow $1 sslh_config_t:file { rw_file_perms create };
allow $1 sslh_config_t:lnk_file read_lnk_file_perms;
')
#######################################
##
## All of the rules required to
## administrate an sslh environment.
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
##
#
interface(`sslh_admin',`
gen_require(`
type sslh_t, sslh_config_t;
type sslh_var_run_t;
type sslh_initrc_exec_t;
')
allow $1 sslh_t:process signal_perms;
ps_process_pattern($1, sslh_t)
init_labeled_script_domtrans($1, sslh_initrc_exec_t)
domain_system_change_exemption($1)
role_transition $2 sslh_initrc_exec_t system_r;
allow $2 system_r;
admin_pattern($1, sslh_config_t)
files_list_pids($1)
admin_pattern($1, sslh_var_run_t)
')