## policy for surrogator
########################################
##
## Execute surrogator_exec_t in the surrogator domain.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`surrogator_domtrans',`
gen_require(`
type surrogator_t, surrogator_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, surrogator_exec_t, surrogator_t)
')
######################################
##
## Execute surrogator in the caller domain.
##
##
##
## Domain allowed access.
##
##
#
interface(`surrogator_exec',`
gen_require(`
type surrogator_exec_t;
')
corecmd_search_bin($1)
can_exec($1, surrogator_exec_t)
')
########################################
##
## Search surrogator cache directories.
##
##
##
## Domain allowed access.
##
##
#
interface(`surrogator_search_cache',`
gen_require(`
type surrogator_cache_t;
')
allow $1 surrogator_cache_t:dir search_dir_perms;
files_search_var($1)
')
########################################
##
## Read surrogator cache files.
##
##
##
## Domain allowed access.
##
##
#
interface(`surrogator_read_cache_files',`
gen_require(`
type surrogator_cache_t;
')
files_search_var($1)
read_files_pattern($1, surrogator_cache_t, surrogator_cache_t)
')
########################################
##
## Create, read, write, and delete
## surrogator cache files.
##
##
##
## Domain allowed access.
##
##
#
interface(`surrogator_manage_cache_files',`
gen_require(`
type surrogator_cache_t;
')
files_search_var($1)
manage_files_pattern($1, surrogator_cache_t, surrogator_cache_t)
')
########################################
##
## Manage surrogator cache dirs.
##
##
##
## Domain allowed access.
##
##
#
interface(`surrogator_manage_cache_dirs',`
gen_require(`
type surrogator_cache_t;
')
files_search_var($1)
manage_dirs_pattern($1, surrogator_cache_t, surrogator_cache_t)
')
########################################
##
## Search surrogator lib directories.
##
##
##
## Domain allowed access.
##
##
#
interface(`surrogator_search_lib',`
gen_require(`
type surrogator_var_lib_t;
')
allow $1 surrogator_var_lib_t:dir search_dir_perms;
files_search_var_lib($1)
')
########################################
##
## Read surrogator lib files.
##
##
##
## Domain allowed access.
##
##
#
interface(`surrogator_read_lib_files',`
gen_require(`
type surrogator_var_lib_t;
')
files_search_var_lib($1)
read_files_pattern($1, surrogator_var_lib_t, surrogator_var_lib_t)
')
########################################
##
## Manage surrogator lib files.
##
##
##
## Domain allowed access.
##
##
#
interface(`surrogator_manage_lib_files',`
gen_require(`
type surrogator_var_lib_t;
')
files_search_var_lib($1)
manage_files_pattern($1, surrogator_var_lib_t, surrogator_var_lib_t)
')
########################################
##
## Manage surrogator lib directories.
##
##
##
## Domain allowed access.
##
##
#
interface(`surrogator_manage_lib_dirs',`
gen_require(`
type surrogator_var_lib_t;
')
files_search_var_lib($1)
manage_dirs_pattern($1, surrogator_var_lib_t, surrogator_var_lib_t)
')
########################################
##
## All of the rules required to administrate
## an surrogator environment
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
##
#
interface(`surrogator_admin',`
gen_require(`
type surrogator_t;
type surrogator_cache_t;
type surrogator_var_lib_t;
')
allow $1 surrogator_t:process { signal_perms };
ps_process_pattern($1, surrogator_t)
tunable_policy(`deny_ptrace',`',`
allow $1 surrogator_t:process ptrace;
')
files_search_var($1)
admin_pattern($1, surrogator_cache_t)
files_search_var_lib($1)
admin_pattern($1, surrogator_var_lib_t)
optional_policy(`
systemd_passwd_agent_exec($1)
systemd_read_fifo_file_passwd_run($1)
')
')