## Manager for dynamically switching between networks.
########################################
##
## Read and write networkmanager udp sockets.
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_rw_udp_sockets',`
gen_require(`
type NetworkManager_t;
')
allow $1 NetworkManager_t:udp_socket { read write };
')
########################################
##
## Read and write networkmanager packet sockets.
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_rw_packet_sockets',`
gen_require(`
type NetworkManager_t;
')
allow $1 NetworkManager_t:packet_socket { read write };
')
#######################################
##
## Relabel networkmanager tun socket.
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_attach_tun_iface',`
gen_require(`
type NetworkManager_t;
')
allow $1 NetworkManager_t:tun_socket relabelfrom;
allow $1 self:tun_socket relabelto;
')
########################################
##
## Read and write networkmanager netlink
## routing sockets.
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_rw_routing_sockets',`
gen_require(`
type NetworkManager_t;
')
allow $1 NetworkManager_t:netlink_route_socket { read write };
')
########################################
##
## Execute networkmanager with a domain transition.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`networkmanager_domtrans',`
gen_require(`
type NetworkManager_t, NetworkManager_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, NetworkManager_exec_t, NetworkManager_t)
')
########################################
##
## Execute networkmanager scripts with
## an automatic domain transition to initrc.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`networkmanager_initrc_domtrans',`
gen_require(`
type NetworkManager_initrc_exec_t;
')
init_labeled_script_domtrans($1, NetworkManager_initrc_exec_t)
')
########################################
##
## Send and receive messages from
## networkmanager over dbus.
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_dbus_chat',`
gen_require(`
type NetworkManager_t;
class dbus send_msg;
')
allow $1 NetworkManager_t:dbus send_msg;
allow NetworkManager_t $1:dbus send_msg;
')
#######################################
##
## Read metworkmanager process state files.
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_read_state',`
gen_require(`
type NetworkManager_t;
')
allow $1 NetworkManager_t:dir search_dir_perms;
allow $1 NetworkManager_t:file read_file_perms;
allow $1 NetworkManager_t:lnk_file read_lnk_file_perms;
')
########################################
##
## Send generic signals to networkmanager.
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_signal',`
gen_require(`
type NetworkManager_t;
')
allow $1 NetworkManager_t:process signal;
')
########################################
##
## Watch networkmanager etc dirs.
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_watch_etc_dirs',`
gen_require(`
type NetworkManager_etc_t;
')
allow $1 NetworkManager_etc_t:dir watch;
')
########################################
##
## Read networkmanager etc files.
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_read_etc_files',`
gen_require(`
type NetworkManager_etc_t;
')
files_search_etc($1)
list_dirs_pattern($1, NetworkManager_etc_t, NetworkManager_etc_t)
read_files_pattern($1, NetworkManager_etc_t, NetworkManager_etc_t)
')
########################################
##
## Create, read, and write
## networkmanager library files.
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_manage_lib_files',`
gen_require(`
type NetworkManager_var_lib_t;
')
files_search_var_lib($1)
manage_files_pattern($1, NetworkManager_var_lib_t, NetworkManager_var_lib_t)
allow $1 NetworkManager_var_lib_t:file map;
')
########################################
##
## Read networkmanager lib files.
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_read_lib_files',`
gen_require(`
type NetworkManager_var_lib_t;
')
files_search_var_lib($1)
list_dirs_pattern($1, NetworkManager_var_lib_t, NetworkManager_var_lib_t)
read_files_pattern($1, NetworkManager_var_lib_t, NetworkManager_var_lib_t)
allow $1 NetworkManager_var_lib_t:file map;
')
########################################
##
## Append networkmanager log files.
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_append_log_files',`
gen_require(`
type NetworkManager_log_t;
')
logging_search_logs($1)
allow $1 NetworkManager_log_t:dir list_dir_perms;
append_files_pattern($1, NetworkManager_log_t, NetworkManager_log_t)
')
########################################
##
## Read networkmanager pid files. (Deprecated)
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_read_pid_files',`
refpolicywarn(`$0($*) has been deprecated, please use networkmanager_read_runtime_files() instead.')
networkmanager_read_runtime_files($1)
')
########################################
##
## Read networkmanager runtime files.
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_read_runtime_files',`
gen_require(`
type NetworkManager_runtime_t;
')
files_search_runtime($1)
read_files_pattern($1, NetworkManager_runtime_t, NetworkManager_runtime_t)
')
####################################
##
## Connect to networkmanager over
## a unix domain stream socket.
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_stream_connect',`
gen_require(`
type NetworkManager_t, NetworkManager_runtime_t;
')
files_search_runtime($1)
stream_connect_pattern($1, NetworkManager_runtime_t, NetworkManager_runtime_t, NetworkManager_t)
')
########################################
##
## Allow specified domain to enable/disable NetworkManager units
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_enabledisable',`
gen_require(`
type NetworkManager_unit_t;
class service { enable disable };
')
allow $1 NetworkManager_unit_t:service { enable disable };
')
########################################
##
## Allow specified domain to start/stop NetworkManager units
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_startstop',`
gen_require(`
type NetworkManager_unit_t;
class service { start stop };
')
allow $1 NetworkManager_unit_t:service { start stop };
')
########################################
##
## Allow specified domain to get status of NetworkManager
##
##
##
## Domain allowed access.
##
##
#
interface(`networkmanager_status',`
gen_require(`
type NetworkManager_unit_t;
class service status;
')
allow $1 NetworkManager_unit_t:service status;
')
########################################
##
## All of the rules required to
## administrate an networkmanager environment.
##
##
##
## Domain allowed access.
##
##
##
##
## Role allowed access.
##
##
##
#
interface(`networkmanager_admin',`
gen_require(`
type NetworkManager_t, NetworkManager_initrc_exec_t, NetworkManager_etc_t;
type NetworkManager_etc_rw_t, NetworkManager_log_t, NetworkManager_tmp_t;
type NetworkManager_var_lib_t, NetworkManager_runtime_t, wpa_cli_t;
')
allow $1 { wpa_cli_t NetworkManager_t }:process { ptrace signal_perms };
ps_process_pattern($1, { wpa_cli_t NetworkManager_t })
init_startstop_service($1, $2, NetworkManager_t, NetworkManager_initrc_exec_t)
files_search_etc($1)
admin_pattern($1, { NetworkManager_etc_t NetworkManager_etc_rw_t })
logging_search_logs($1)
admin_pattern($1, NetworkManager_log_t)
files_search_var_lib($1)
admin_pattern($1, NetworkManager_var_lib_t)
allow $1 NetworkManager_var_lib_t:file map;
files_search_runtime($1)
admin_pattern($1, NetworkManager_runtime_t)
files_search_tmp($1)
admin_pattern($1, NetworkManager_tmp_t)
')