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>
Dominick Grift 288845
##	Domain allowed to transition.
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>
Dominick Grift 288845
##	Domain allowed to transition.
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>
Dan Walsh 3eaa99
##	Send and receive messages from
Dan Walsh 3eaa99
##	NetworkManager over dbus.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed access.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`networkmanager_dontaudit_dbus_chat',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type NetworkManager_t;
Dan Walsh 3eaa99
		class dbus send_msg;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	dontaudit $1 NetworkManager_t:dbus send_msg;
Dan Walsh 3eaa99
	dontaudit NetworkManager_t $1:dbus send_msg;
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <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
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	Execute NetworkManager in the NetworkManager domain, and
Dan Walsh 3eaa99
##	allow the specified role the NetworkManager domain.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed access.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
## <param name="role">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	The role to be allowed the NetworkManager domain.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
## <rolecap/>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`networkmanager_run',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type NetworkManager_t, NetworkManager_exec_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	networkmanager_domtrans($1)
Dan Walsh 3eaa99
	role $2 types NetworkManager_t;
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	Allow the specified domain to append
Dan Walsh 3eaa99
##	to Network Manager log files.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	Domain allowed access.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`networkmanager_append_log',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type NetworkManager_log_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	logging_search_logs($1)
Dan Walsh 3eaa99
	allow $1 NetworkManager_log_t:dir list_dir_perms;
Dan Walsh 3eaa99
	append_files_pattern($1, NetworkManager_log_t, NetworkManager_log_t)
Dan Walsh 3eaa99
')