## Jabber instant messaging servers.
#######################################
##
## The template to define a jabber domain.
##
##
##
## Domain prefix to be used.
##
##
#
template(`jabber_domain_template',`
gen_require(`
attribute jabberd_domain;
')
type $1_t, jabberd_domain;
type $1_exec_t;
init_daemon_domain($1_t, $1_exec_t)
')
########################################
##
## Create, read, write, and delete
## jabber lib files.
##
##
##
## Domain allowed access.
##
##
#
interface(`jabber_manage_lib_files',`
gen_require(`
type jabberd_var_lib_t;
')
files_search_var_lib($1)
manage_files_pattern($1, jabberd_var_lib_t, jabberd_var_lib_t)
')
########################################
##
## Connect to jabber over a TCP socket (Deprecated)
##
##
##
## Domain allowed access.
##
##
#
interface(`jabber_tcp_connect',`
refpolicywarn(`$0($*) has been deprecated.')
')
########################################
##
## All of the rules required to
## administrate an jabber environment.
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
##
#
interface(`jabber_admin',`
gen_require(`
attribute jabberd_domain;
type jabberd_lock_t, jabberd_log_t, jabberd_spool_t;
type jabberd_var_lib_t, jabberd_var_run_t, jabberd_initrc_exec_t;
')
allow $1 jabberd_domain:process { ptrace signal_perms };
ps_process_pattern($1, jabberd_domain)
init_labeled_script_domtrans($1, jabberd_initrc_exec_t)
domain_system_change_exemption($1)
role_transition $2 jabberd_initrc_exec_t system_r;
allow $2 system_r;
files_search_locks($1)
admin_pattern($1, jabberd_lock_t)
logging_search_logs($1)
admin_pattern($1, jabberd_log_t)
files_search_spool($1)
admin_pattern($1, jabberd_spool_t)
files_search_var_lib($1)
admin_pattern($1, jabberd_var_lib_t)
files_search_pids($1)
admin_pattern($1, jabberd_var_run_t)
')
########################################
##
## Execute ejabberd with a domain transition.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`jabber_domtrans',`
gen_require(`
type jabberd_t, jabberd_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, jabberd_exec_t, jabberd_t)
')