## policy for dirsrv
########################################
##
## Execute a domain transition to run dirsrv.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`dirsrv_domtrans',`
gen_require(`
type dirsrv_t, dirsrv_exec_t;
')
domtrans_pattern($1, dirsrv_exec_t,dirsrv_t)
')
########################################
##
## Execute dirsrv in the dirsrv domain, and
## allow the specified role the dirsrv domain.
##
##
##
## Domain allowed to transition.
##
##
##
##
## Role allowed access.
##
##
#
interface(`dirsrv_run',`
gen_require(`
type dirsrv_t;
')
dirsrv_domtrans($1)
role $2 types dirsrv_t;
')
########################################
##
## Allow caller to signal dirsrv.
##
##
##
## Domain allowed access.
##
##
#
interface(`dirsrv_signal',`
gen_require(`
type dirsrv_t;
')
allow $1 dirsrv_t:process signal;
')
########################################
##
## Send a null signal to dirsrv.
##
##
##
## Domain allowed access.
##
##
#
interface(`dirsrv_signull',`
gen_require(`
type dirsrv_t;
')
allow $1 dirsrv_t:process signull;
')
########################################
##
## Execute dirsrv server in the dirsrv domain.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`dirsrv_systemctl',`
gen_require(`
type dirsrv_unit_file_t;
type dirsrv_t;
')
systemd_exec_systemctl($1)
init_reload_services($1)
allow $1 dirsrv_unit_file_t:file read_file_perms;
allow $1 dirsrv_unit_file_t:service manage_service_perms;
ps_process_pattern($1, dirsrv_t)
')
#######################################
##
## Allow a domain to manage dirsrv logs.
##
##
##
## Domain allowed access.
##
##
#
interface(`dirsrv_manage_log',`
gen_require(`
type dirsrv_var_log_t;
')
allow $1 dirsrv_var_log_t:dir manage_dir_perms;
allow $1 dirsrv_var_log_t:file manage_file_perms;
allow $1 dirsrv_var_log_t:fifo_file manage_fifo_file_perms;
')
#######################################
##
## Allow a domain to manage dirsrv /var/lib files.
##
##
##
## Domain allowed access.
##
##
#
interface(`dirsrv_manage_var_lib',`
gen_require(`
type dirsrv_var_lib_t;
')
allow $1 dirsrv_var_lib_t:dir manage_dir_perms;
allow $1 dirsrv_var_lib_t:file manage_file_perms;
')
########################################
##
## Connect to dirsrv over a unix stream socket.
##
##
##
## Domain allowed access.
##
##
#
interface(`dirsrv_stream_connect',`
gen_require(`
type dirsrv_t, dirsrv_var_run_t;
')
files_search_pids($1)
stream_connect_pattern($1, dirsrv_var_run_t, dirsrv_var_run_t, dirsrv_t)
')
#######################################
##
## Allow a domain to manage dirsrv /var/run files.
##
##
##
## Domain allowed access.
##
##
#
interface(`dirsrv_manage_var_run',`
gen_require(`
type dirsrv_var_run_t;
')
allow $1 dirsrv_var_run_t:dir manage_dir_perms;
allow $1 dirsrv_var_run_t:file manage_file_perms;
allow $1 dirsrv_var_run_t:sock_file manage_file_perms;
')
######################################
##
## Allow a domain to create dirsrv pid directories.
##
##
##
## Domain allowed access.
##
##
#
interface(`dirsrv_pid_filetrans',`
gen_require(`
type dirsrv_var_run_t;
')
# Allow creating a dir in /var/run with this type
files_pid_filetrans($1, dirsrv_var_run_t, dir)
')
#######################################
##
## Allow a domain to read dirsrv /var/run files.
##
##
##
## Domain allowed access.
##
##
#
interface(`dirsrv_read_var_run',`
gen_require(`
type dirsrv_var_run_t;
')
allow $1 dirsrv_var_run_t:dir list_dir_perms;
allow $1 dirsrv_var_run_t:file read_file_perms;
')
########################################
##
## Manage dirsrv configuration files.
##
##
##
## Domain allowed access.
##
##
#
interface(`dirsrv_manage_config',`
gen_require(`
type dirsrv_config_t;
')
allow $1 dirsrv_config_t:dir manage_dir_perms;
allow $1 dirsrv_config_t:file manage_file_perms;
')
########################################
##
## Read dirsrv share files.
##
##
##
## Domain allowed access.
##
##
#
interface(`dirsrv_read_share',`
gen_require(`
type dirsrv_share_t;
')
allow $1 dirsrv_share_t:dir list_dir_perms;
allow $1 dirsrv_share_t:file { map read_file_perms };
allow $1 dirsrv_share_t:lnk_file read;
')
########################################
##
## Allow dirsrv noatsecure
##
##
##
## Domain allowed access.
##
##
#
interface(`dirsrv_noatsecure',`
gen_require(`
type dirsrv_t;
')
allow $1 dirsrv_t:process { noatsecure };
')
########################################
##
## Do not audit attempts to list dirsrv tmpfs directories
##
##
##
## Domain to not audit
##
##
#
interface(`dirsrv_dontaudit_list_tmpfs_dirs',`
gen_require(`
type dirsrv_tmpfs_t;
')
dontaudit $1 dirsrv_tmpfs_t:dir list_dir_perms;
')