## Jabber instant messaging server
#####################################
##
## Creates types and rules for a basic
## jabber init daemon domain.
##
##
##
## Prefix for the domain.
##
##
#
template(`jabber_domain_template',`
gen_require(`
attribute jabberd_domain;
')
##############################
#
# $1_t declarations
#
type $1_t, jabberd_domain;
type $1_exec_t;
init_daemon_domain($1_t, $1_exec_t)
kernel_read_system_state($1_t)
corenet_all_recvfrom_netlabel($1_t)
logging_send_syslog_msg($1_t)
')
#######################################
##
## Execute a domain transition to run jabberd services
##
##
##
## Domain allowed to transition.
##
##
#
interface(`jabber_domtrans_jabberd',`
gen_require(`
type jabberd_t, jabberd_exec_t;
')
domtrans_pattern($1, jabberd_exec_t, jabberd_t)
')
######################################
##
## Execute a domain transition to run jabberd router service
##
##
##
## Domain allowed to transition.
##
##
#
interface(`jabber_domtrans_jabberd_router',`
gen_require(`
type jabberd_router_t, jabberd_router_exec_t;
')
domtrans_pattern($1, jabberd_router_exec_t, jabberd_router_t)
')
#######################################
##
## Read jabberd lib files.
##
##
##
## Domain allowed access.
##
##
#
interface(`jabberd_read_lib_files',`
gen_require(`
type jabberd_var_lib_t;
')
files_search_var_lib($1)
read_files_pattern($1, jabberd_var_lib_t, jabberd_var_lib_t)
')
#######################################
##
## Dontaudit inherited read jabberd lib files.
##
##
##
## Domain to not audit.
##
##
#
interface(`jabberd_dontaudit_read_lib_files',`
gen_require(`
type jabberd_var_lib_t;
')
dontaudit $1 jabberd_var_lib_t:file read_inherited_file_perms;
')
#######################################
##
## Create, read, write, and delete
## jabberd lib files.
##
##
##
## Domain allowed access.
##
##
#
interface(`jabberd_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)
')
########################################
##
## All of the rules required to administrate
## an jabber environment
##
##
##
## Domain allowed access.
##
##
##
##
## The role to be allowed to manage the jabber domain.
##
##
##
#
interface(`jabber_admin',`
gen_require(`
type jabberd_t, jabberd_var_lib_t;
type jabberd_initrc_exec_t, jabberd_router_t;
type jabberd_lock_t;
type jabberd_var_spool_t;
')
allow $1 jabberd_t:process signal_perms;
ps_process_pattern($1, jabberd_t)
tunable_policy(`deny_ptrace',`',`
allow $1 jabberd_t:process ptrace;
allow $1 jabberd_router_t:process ptrace;
')
allow $1 jabberd_router_t:process signal_perms;
ps_process_pattern($1, jabberd_router_t)
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)
files_search_spool($1)
admin_pattern($1, jabberd_var_spool_t)
files_search_var_lib($1)
admin_pattern($1, jabberd_var_lib_t)
')