Chris PeBenito 17de1b
## <summary>Manager for dynamically switching between networks.</summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read and write NetworkManager UDP sockets.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# cjp: added for named.
Chris PeBenito 17de1b
interface(`networkmanager_rw_udp_sockets',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type NetworkManager_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 NetworkManager_t:udp_socket { read write };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read and write NetworkManager packet sockets.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# cjp: added for named.
Chris PeBenito 17de1b
interface(`networkmanager_rw_packet_sockets',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type NetworkManager_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 NetworkManager_t:packet_socket { read write };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito baea7b
#######################################
Chris PeBenito baea7b
## <summary>
Chris PeBenito baea7b
## Allow caller to relabel tun_socket
Chris PeBenito baea7b
## </summary>
Chris PeBenito baea7b
## <param name="domain">
Chris PeBenito baea7b
## <summary>
Chris PeBenito baea7b
## Domain allowed access.
Chris PeBenito baea7b
## </summary>
Chris PeBenito baea7b
## </param>
Chris PeBenito baea7b
#
Chris PeBenito baea7b
interface(`networkmanager_attach_tun_iface',`
Chris PeBenito baea7b
	gen_require(`
Chris PeBenito baea7b
		type NetworkManager_t;
Chris PeBenito baea7b
	')
Chris PeBenito baea7b
Chris PeBenito baea7b
	allow $1 NetworkManager_t:tun_socket relabelfrom;
Chris PeBenito baea7b
	allow $1 self:tun_socket relabelto;
Chris PeBenito baea7b
')
Chris PeBenito baea7b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Read and write NetworkManager netlink
Chris PeBenito 17de1b
##	routing sockets.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# cjp: added for named.
Chris PeBenito 17de1b
interface(`networkmanager_rw_routing_sockets',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type NetworkManager_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 NetworkManager_t:netlink_route_socket { read write };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito baea7b
##	Execute NetworkManager with a domain transition.
Chris PeBenito f7101c
## </summary>
Chris PeBenito f7101c
## <param name="domain">
Chris PeBenito f7101c
##	<summary>
Chris PeBenito f7101c
##	Domain allowed access.
Chris PeBenito f7101c
##	</summary>
Chris PeBenito f7101c
## </param>
Chris PeBenito f7101c
#
Chris PeBenito f7101c
interface(`networkmanager_domtrans',`
Chris PeBenito f7101c
	gen_require(`
Chris PeBenito f7101c
		type NetworkManager_t, NetworkManager_exec_t;
Chris PeBenito f7101c
	')
Chris PeBenito f7101c
Chris PeBenito f7101c
	corecmd_search_bin($1)
Chris PeBenito 0bfccd
	domtrans_pattern($1, NetworkManager_exec_t, NetworkManager_t)
Chris PeBenito f7101c
')
Chris PeBenito f7101c
Chris PeBenito f7101c
########################################
Chris PeBenito f7101c
## <summary>
Chris PeBenito baea7b
##	Execute NetworkManager scripts with an automatic domain transition to initrc.
Chris PeBenito baea7b
## </summary>
Chris PeBenito baea7b
## <param name="domain">
Chris PeBenito baea7b
##	<summary>
Chris PeBenito baea7b
##	Domain allowed access.
Chris PeBenito baea7b
##	</summary>
Chris PeBenito baea7b
## </param>
Chris PeBenito baea7b
#
Chris PeBenito baea7b
interface(`networkmanager_initrc_domtrans',`
Chris PeBenito baea7b
	gen_require(`
Chris PeBenito baea7b
		type NetworkManager_initrc_exec_t;
Chris PeBenito baea7b
	')
Chris PeBenito baea7b
Chris PeBenito baea7b
	init_labeled_script_domtrans($1, NetworkManager_initrc_exec_t)
Chris PeBenito baea7b
')
Chris PeBenito baea7b
Chris PeBenito baea7b
########################################
Chris PeBenito baea7b
## <summary>
Chris PeBenito 17de1b
##	Send and receive messages from
Chris PeBenito 17de1b
##	NetworkManager over dbus.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`networkmanager_dbus_chat',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type NetworkManager_t;
Chris PeBenito 17de1b
		class dbus send_msg;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 NetworkManager_t:dbus send_msg;
Chris PeBenito 17de1b
	allow NetworkManager_t $1:dbus send_msg;
Chris PeBenito 17de1b
')
Chris PeBenito ae3386
Chris PeBenito ae3386
########################################
Chris PeBenito ae3386
## <summary>
Chris PeBenito ae3386
##	Send a generic signal to NetworkManager
Chris PeBenito ae3386
## </summary>
Chris PeBenito ae3386
## <param name="domain">
Chris PeBenito ae3386
##	<summary>
Chris PeBenito ae3386
##	Domain allowed access.
Chris PeBenito ae3386
##	</summary>
Chris PeBenito ae3386
## </param>
Chris PeBenito ae3386
#
Chris PeBenito ae3386
interface(`networkmanager_signal',`
Chris PeBenito ae3386
	gen_require(`
Chris PeBenito ae3386
		type NetworkManager_t;
Chris PeBenito ae3386
	')
Chris PeBenito ae3386
Chris PeBenito ae3386
	allow $1 NetworkManager_t:process signal;
Chris PeBenito ae3386
')
Chris PeBenito ae3386
Chris PeBenito ae3386
########################################
Chris PeBenito ae3386
## <summary>
Chris PeBenito baea7b
##	Read NetworkManager lib files.
Chris PeBenito baea7b
## </summary>
Chris PeBenito baea7b
## <param name="domain">
Chris PeBenito baea7b
##	<summary>
Chris PeBenito baea7b
##	Domain allowed access.
Chris PeBenito baea7b
##	</summary>
Chris PeBenito baea7b
## </param>
Chris PeBenito baea7b
#
Chris PeBenito baea7b
interface(`networkmanager_read_lib_files',`
Chris PeBenito baea7b
	gen_require(`
Chris PeBenito baea7b
		type NetworkManager_var_lib_t;
Chris PeBenito baea7b
	')
Chris PeBenito baea7b
Chris PeBenito baea7b
	files_search_var_lib($1)
Chris PeBenito baea7b
	list_dirs_pattern($1, NetworkManager_var_lib_t, NetworkManager_var_lib_t)
Chris PeBenito baea7b
	read_files_pattern($1, NetworkManager_var_lib_t, NetworkManager_var_lib_t)
Chris PeBenito baea7b
')
Chris PeBenito baea7b
Chris PeBenito baea7b
########################################
Chris PeBenito baea7b
## <summary>
Chris PeBenito ae3386
##	Read NetworkManager PID files.
Chris PeBenito ae3386
## </summary>
Chris PeBenito ae3386
## <param name="domain">
Chris PeBenito ae3386
##	<summary>
Chris PeBenito ae3386
##	Domain allowed access.
Chris PeBenito ae3386
##	</summary>
Chris PeBenito ae3386
## </param>
Chris PeBenito ae3386
#
Chris PeBenito ae3386
interface(`networkmanager_read_pid_files',`
Chris PeBenito ae3386
	gen_require(`
Chris PeBenito ae3386
		type NetworkManager_var_run_t;
Chris PeBenito ae3386
	')
Chris PeBenito ae3386
Chris PeBenito ae3386
	files_search_pids($1)
Chris PeBenito ae3386
	allow $1 NetworkManager_var_run_t:file read_file_perms;
Chris PeBenito ae3386
')