Chris PeBenito 9401ae1
## <summary>Wireshark packet capture tool.</summary>
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
############################################################
Chris PeBenito 9401ae1
## <summary>
Dominick Grift af2d7bd
##	Role access for wireshark.
Chris PeBenito 9401ae1
## </summary>
Chris PeBenito 9401ae1
## <param name="role">
Chris PeBenito 9401ae1
##	<summary>
Dominick Grift af2d7bd
##	Role allowed access.
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
## <param name="domain">
Chris PeBenito 9401ae1
##	<summary>
Dominick Grift af2d7bd
##	User domain for the role.
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
#
Chris PeBenito 9401ae1
interface(`wireshark_role',`
Chris PeBenito 9401ae1
	gen_require(`
Dominick Grift af2d7bd
		attribute_role wireshark_roles;
Dominick Grift af2d7bd
		type wireshark_t, wireshark_exec_t, wireshark_home_t;
Dominick Grift af2d7bd
		type wireshark_tmp_t, wireshark_tmpfs_t;
Chris PeBenito 9401ae1
	')
Chris PeBenito 9401ae1
Dominick Grift af2d7bd
	roleattribute $1 wireshark_roles;
Dominick Grift af2d7bd
Dominick Grift af2d7bd
	domtrans_pattern($2, wireshark_exec_t, wireshark_t)
Chris PeBenito 9401ae1
Dominick Grift af2d7bd
	allow $2 wireshark_t:process { ptrace signal_perms };
Dominick Grift af2d7bd
	ps_process_pattern($2, wireshark_t)
Chris PeBenito 9401ae1
Dominick Grift af2d7bd
	allow $2 { wireshark_tmp_t wireshark_home_t wireshark_tmpfs_t }:dir { manage_dir_perms relabel_dir_perms };
Dominick Grift af2d7bd
	allow $2 { wireshark_tmp_t wireshark_home_t wireshark_tmpfs_t }:file { manage_file_perms relabel_file_perms };
Dominick Grift af2d7bd
	allow $2 { wireshark_home_t wireshark_tmpfs_t }:lnk_file { manage_lnk_file_perms relabel_lnk_file_perms };
Dominick Grift af2d7bd
	allow $2 wireshark_tmpfs_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
Dominick Grift af2d7bd
	allow $2 wireshark_tmpfs_t:fifo_file { manage_fifo_file_perms relabel_fifo_file_perms };
Dominick Grift af2d7bd
	userdom_user_home_dir_filetrans($2, wireshark_home_t, dir, ".wireshark")
Chris PeBenito 9401ae1
')
Chris PeBenito 9401ae1
Chris PeBenito 9401ae1
########################################
Chris PeBenito 9401ae1
## <summary>
Dominick Grift af2d7bd
##	Execute wireshark in wireshark domain.
Chris PeBenito 9401ae1
## </summary>
Chris PeBenito 9401ae1
## <param name="domain">
Chris PeBenito 9401ae1
##	<summary>
Chris PeBenito 9401ae1
##	Domain allowed to transition.
Chris PeBenito 9401ae1
##	</summary>
Chris PeBenito 9401ae1
## </param>
Chris PeBenito 9401ae1
#
Chris PeBenito 9401ae1
interface(`wireshark_domtrans',`
Chris PeBenito 9401ae1
	gen_require(`
Chris PeBenito 9401ae1
		type wireshark_t, wireshark_exec_t;
Chris PeBenito 9401ae1
	')
Chris PeBenito 9401ae1
Dominick Grift af2d7bd
	corecmd_search_bin($1)
Chris PeBenito 9401ae1
	domtrans_pattern($1, wireshark_exec_t, wireshark_t)
Chris PeBenito 9401ae1
')