## policy for rhnsd
########################################
##
## Transition to rhnsd.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`rhnsd_domtrans',`
gen_require(`
type rhnsd_t, rhnsd_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, rhnsd_exec_t, rhnsd_t)
')
########################################
##
## Execute rhnsd server in the rhnsd domain.
##
##
##
## Domain allowed access.
##
##
#
interface(`rhnsd_initrc_domtrans',`
gen_require(`
type rhnsd_initrc_exec_t;
')
init_labeled_script_domtrans($1, rhnsd_initrc_exec_t)
')
########################################
##
## Execute rhnsd server in the rhnsd domain.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`rhnsd_systemctl',`
gen_require(`
type rhnsd_t;
type rhnsd_unit_file_t;
')
systemd_exec_systemctl($1)
init_reload_services($1)
systemd_read_fifo_file_passwd_run($1)
allow $1 rhnsd_unit_file_t:file read_file_perms;
allow $1 rhnsd_unit_file_t:service manage_service_perms;
ps_process_pattern($1, rhnsd_t)
')
######################################
##
## Allow the specified domain to manage
## rhnsd configuration files.
##
##
##
## Domain allowed access.
##
##
#
interface(`rhnsd_manage_config',`
gen_require(`
type rhnsd_conf_t;
')
files_search_etc($1)
manage_files_pattern( $1, rhnsd_conf_t, rhnsd_conf_t)
manage_lnk_files_pattern($1, rhnsd_conf_t, rhnsd_conf_t)
')
######################################
##
## Allow the specified domain to manage
## rhnsd configuration files.
##
##
##
## Domain allowed access.
##
##
#
interface(`rhnsd_read_config',`
gen_require(`
type rhnsd_conf_t;
')
files_search_etc($1)
read_files_pattern($1, rhnsd_conf_t, rhnsd_conf_t)
')
########################################
##
## Allow the specified domain search rhnsd configuration directory
##
##
##
## Domain allowed access.
##
##
#
interface(`rhnsd_search_conf',`
gen_require(`
type rhnsd_conf_t;
')
allow $1 rhnsd_conf_t:dir search_dir_perms;
files_search_etc($1)
')
########################################
##
## All of the rules required to administrate
## an rhnsd environment
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
##
#
interface(`rhnsd_admin',`
gen_require(`
type rhnsd_t;
type rhnsd_initrc_exec_t;
')
allow $1 rhnsd_t:process { ptrace signal_perms };
ps_process_pattern($1, rhnsd_t)
rhnsd_initrc_domtrans($1)
domain_system_change_exemption($1)
role_transition $2 rhnsd_initrc_exec_t system_r;
allow $2 system_r;
optional_policy(`
systemd_passwd_agent_exec($1)
systemd_read_fifo_file_passwd_run($1)
')
')