## policy for transmission
########################################
##
## Execute transmission_exec_t in the transmission domain.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`transmission_domtrans',`
gen_require(`
type transmission_t, transmission_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, transmission_exec_t, transmission_t)
')
######################################
##
## Execute transmission in the caller domain.
##
##
##
## Domain allowed access.
##
##
#
interface(`transmission_exec',`
gen_require(`
type transmission_exec_t;
')
corecmd_search_bin($1)
can_exec($1, transmission_exec_t)
')
########################################
##
## Read transmission's log files.
##
##
##
## Domain allowed access.
##
##
##
#
interface(`transmission_read_log',`
gen_require(`
type transmission_log_t;
')
logging_search_logs($1)
read_files_pattern($1, transmission_log_t, transmission_log_t)
')
########################################
##
## Append to transmission log files.
##
##
##
## Domain allowed access.
##
##
#
interface(`transmission_append_log',`
gen_require(`
type transmission_log_t;
')
logging_search_logs($1)
append_files_pattern($1, transmission_log_t, transmission_log_t)
')
########################################
##
## Manage transmission log files
##
##
##
## Domain allowed access.
##
##
#
interface(`transmission_manage_log',`
gen_require(`
type transmission_log_t;
')
logging_search_logs($1)
manage_dirs_pattern($1, transmission_log_t, transmission_log_t)
manage_files_pattern($1, transmission_log_t, transmission_log_t)
manage_lnk_files_pattern($1, transmission_log_t, transmission_log_t)
')
########################################
##
## Search transmission lib directories.
##
##
##
## Domain allowed access.
##
##
#
interface(`transmission_search_lib',`
gen_require(`
type transmission_var_lib_t;
')
allow $1 transmission_var_lib_t:dir search_dir_perms;
files_search_var_lib($1)
')
########################################
##
## Read transmission lib files.
##
##
##
## Domain allowed access.
##
##
#
interface(`transmission_read_lib_files',`
gen_require(`
type transmission_var_lib_t;
')
files_search_var_lib($1)
read_files_pattern($1, transmission_var_lib_t, transmission_var_lib_t)
')
########################################
##
## Manage transmission lib files.
##
##
##
## Domain allowed access.
##
##
#
interface(`transmission_manage_lib_files',`
gen_require(`
type transmission_var_lib_t;
')
files_search_var_lib($1)
manage_files_pattern($1, transmission_var_lib_t, transmission_var_lib_t)
')
########################################
##
## Manage transmission lib directories.
##
##
##
## Domain allowed access.
##
##
#
interface(`transmission_manage_lib_dirs',`
gen_require(`
type transmission_var_lib_t;
')
files_search_var_lib($1)
manage_dirs_pattern($1, transmission_var_lib_t, transmission_var_lib_t)
')
########################################
##
## Read transmission PID files.
##
##
##
## Domain allowed access.
##
##
#
interface(`transmission_read_pid_files',`
gen_require(`
type transmission_var_run_t;
')
files_search_pids($1)
read_files_pattern($1, transmission_var_run_t, transmission_var_run_t)
')
########################################
##
## Transmission PID files trsansiotions.
##
##
##
## Domain allowed access.
##
##
#
interface(`transmission_pid_trans',`
gen_require(`
type transmission_t;
type var_run_t;
type transmission_var_run_t;
type initrc_t;
')
manage_dirs_pattern(transmission_t, transmission_var_run_t, transmission_var_run_t)
manage_files_pattern(transmission_t, transmission_var_run_t, transmission_var_run_t)
manage_lnk_files_pattern(transmission_t, transmission_var_run_t, transmission_var_run_t)
files_pid_filetrans(transmission_t, transmission_var_run_t, { dir file lnk_file })
filetrans_pattern(initrc_t, var_run_t, transmission_var_run_t, dir, "transmission")
')
########################################
##
## All of the rules required to administrate
## an transmission environment
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
##
#
interface(`transmission_admin',`
gen_require(`
type transmission_t;
type transmission_log_t;
type transmission_var_lib_t;
type transmission_var_run_t;
')
allow $1 transmission_t:process { signal_perms };
ps_process_pattern($1, transmission_t)
tunable_policy(`deny_ptrace',`',`
allow $1 transmission_t:process ptrace;
')
logging_search_logs($1)
admin_pattern($1, transmission_log_t)
files_search_var_lib($1)
admin_pattern($1, transmission_var_lib_t)
files_search_pids($1)
admin_pattern($1, transmission_var_run_t)
optional_policy(`
systemd_passwd_agent_exec($1)
systemd_read_fifo_file_passwd_run($1)
')
')
########################################
##
## Bind TCP sockets to the transmission peer port.
##
##
##
## Domain allowed access.
##
##
##
#
interface(`corenet_tcp_bind_transmission_peer_port',`
gen_require(`
type transmission_peer_port_t;
')
allow $1 transmission_peer_port_t:tcp_socket name_bind;
')
########################################
##
## Bind UDP sockets to the transmission peer port.
##
##
##
## Domain allowed access.
##
##
##
#
interface(`corenet_udp_bind_transmission_peer_port',`
gen_require(`
type transmission_peer_port_t;
')
allow $1 transmission_peer_port_t:udp_socket name_bind;
')
########################################
##
## Bind TCP sockets to the transmission rpc port.
##
##
##
## Domain allowed access.
##
##
##
#
interface(`corenet_tcp_bind_transmission_rpc_port',`
gen_require(`
type transmission_rpc_port_t;
')
allow $1 transmission_rpc_port_t:tcp_socket name_bind;
')