## Daemon for Linux systems providing a stable D-BUS interface to manage the deployment of Server Roles.
########################################
##
## Execute rolekit in the rolekit domin.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`rolekit_domtrans',`
gen_require(`
type rolekit_t, rolekit_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, rolekit_exec_t, rolekit_t)
')
########################################
##
## Execute rolekit server in the rolekit domain.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`rolekit_systemctl',`
gen_require(`
type rolekit_t;
type rolekit_unit_file_t;
')
systemd_exec_systemctl($1)
init_reload_services($1)
systemd_read_fifo_file_passwd_run($1)
allow $1 rolekit_unit_file_t:file read_file_perms;
allow $1 rolekit_unit_file_t:service manage_service_perms;
ps_process_pattern($1, rolekit_t)
')
#######################################
##
## Manage rolekit kernel keyrings.
##
##
##
## Domain allowed access.
##
##
#
interface(`rolekit_manage_keys',`
gen_require(`
type rolekit_t;
')
allow $1 rolekit_t:key manage_key_perms;
allow rolekit_t $1:key manage_key_perms;
')
########################################
##
## Send and receive messages from
## policykit over dbus.
##
##
##
## Domain allowed access.
##
##
#
interface(`rolekit_dbus_chat',`
gen_require(`
type rolekit_t;
class dbus send_msg;
')
ps_process_pattern(rolekit_t, $1)
allow $1 rolekit_t:dbus send_msg;
allow rolekit_t $1:dbus send_msg;
')
########################################
##
## All of the rules required to administrate
## an rolekit environment
##
##
##
## Domain allowed access.
##
##
##
#
interface(`rolekit_admin',`
gen_require(`
type rolekit_t;
type rolekit_unit_file_t;
')
allow $1 rolekit_t:process { signal_perms };
ps_process_pattern($1, rolekit_t)
tunable_policy(`deny_ptrace',`',`
allow $1 rolekit_t:process ptrace;
')
rolekit_systemctl($1)
admin_pattern($1, rolekit_unit_file_t)
allow $1 rolekit_unit_file_t:service all_service_perms;
optional_policy(`
systemd_passwd_agent_exec($1)
systemd_read_fifo_file_passwd_run($1)
')
')
#######################################
##
## Send to rolekit with a unix dgram socket.
##
##
##
## Domain allowed access.
##
##
#
interface(`rolekit_dgram_send',`
gen_require(`
type rolekit_t;
')
allow $1 rolekit_t:unix_dgram_socket sendto;
')