## Devicekit modular hardware abstraction layer
########################################
##
## Execute a domain transition to run devicekit.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`devicekit_domtrans',`
gen_require(`
type devicekit_t, devicekit_exec_t;
')
domtrans_pattern($1, devicekit_exec_t, devicekit_t)
')
########################################
##
## Send to devicekit over a unix domain
## datagram socket.
##
##
##
## Domain allowed access.
##
##
#
interface(`devicekit_dgram_send',`
gen_require(`
type devicekit_t;
')
allow $1 devicekit_t:unix_dgram_socket sendto;
')
########################################
##
## Send and receive messages from
## devicekit over dbus.
##
##
##
## Domain allowed access.
##
##
#
interface(`devicekit_dbus_chat',`
gen_require(`
type devicekit_t;
class dbus send_msg;
')
allow $1 devicekit_t:dbus send_msg;
allow devicekit_t $1:dbus send_msg;
')
########################################
##
## Send and receive messages from
## devicekit disk over dbus.
##
##
##
## Domain allowed access.
##
##
#
interface(`devicekit_dbus_chat_disk',`
gen_require(`
type devicekit_disk_t;
class dbus send_msg;
')
allow $1 devicekit_disk_t:dbus send_msg;
allow devicekit_disk_t $1:dbus send_msg;
')
########################################
##
## Send signal devicekit power
##
##
##
## Domain allowed access.
##
##
#
interface(`devicekit_signal_power',`
gen_require(`
type devicekit_power_t;
')
allow $1 devicekit_power_t:process signal;
')
########################################
##
## Send and receive messages from
## devicekit power over dbus.
##
##
##
## Domain allowed access.
##
##
#
interface(`devicekit_dbus_chat_power',`
gen_require(`
type devicekit_power_t;
class dbus send_msg;
')
allow $1 devicekit_power_t:dbus send_msg;
allow devicekit_power_t $1:dbus send_msg;
')
########################################
##
## Read devicekit PID files.
##
##
##
## Domain allowed access.
##
##
#
interface(`devicekit_read_pid_files',`
gen_require(`
type devicekit_var_run_t;
')
files_search_pids($1)
read_files_pattern($1, devicekit_var_run_t, devicekit_var_run_t)
')
########################################
##
## All of the rules required to administrate
## an devicekit environment
##
##
##
## Domain allowed access.
##
##
##
##
## The role to be allowed to manage the devicekit domain.
##
##
##
##
## The type of the user terminal.
##
##
##
#
interface(`devicekit_admin',`
gen_require(`
type devicekit_t, devicekit_disk_t, devicekit_power_t;
type devicekit_var_lib_t, devicekit_var_run_t, devicekit_tmp_t;
')
allow $1 devicekit_t:process { ptrace signal_perms getattr };
ps_process_pattern($1, devicekit_t)
allow $1 devicekit_disk_t:process { ptrace signal_perms getattr };
ps_process_pattern($1, devicekit_disk_t)
allow $1 devicekit_power_t:process { ptrace signal_perms getattr };
ps_process_pattern($1, devicekit_power_t)
admin_pattern($1, devicekit_tmp_t)
files_search_tmp($1)
admin_pattern($1, devicekit_var_lib_t)
files_search_var_lib($1)
admin_pattern($1, devicekit_var_run_t)
files_search_pids($1)
')