aboutsummaryrefslogtreecommitdiff
blob: ea6ffe657b12747018879cee7a3085c3e377141a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
## <summary>Wireshark packet capture tool.</summary>

############################################################
## <summary>
##	Role access for wireshark
## </summary>
## <param name="role">
##	<summary>
##	Role allowed access
##	</summary>
## </param>
## <param name="domain">
##	<summary>
##	User domain for the role
##	</summary>
## </param>
#
interface(`wireshark_role',`
	gen_require(`
		type wireshark_t, wireshark_exec_t;
		type wireshark_home_t, wireshark_tmp_t;
		type wireshark_tmpfs_t;
	')

	role $1 types wireshark_t;

	domain_auto_trans($2, wireshark_exec_t, wireshark_t)
	allow wireshark_t $2:fd use;
	allow wireshark_t $2:process sigchld;

	manage_dirs_pattern($2, wireshark_home_t, wireshark_home_t)
	manage_files_pattern($2, wireshark_home_t, wireshark_home_t)
	manage_lnk_files_pattern($2, wireshark_home_t, wireshark_home_t)
	relabel_dirs_pattern($2, wireshark_home_t, wireshark_home_t)
	relabel_files_pattern($2, wireshark_home_t, wireshark_home_t)
	relabel_lnk_files_pattern($2, wireshark_home_t, wireshark_home_t)
')

########################################
## <summary>
##	Run wireshark in wireshark domain.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed to transition.
##	</summary>
## </param>
#
interface(`wireshark_domtrans',`
	gen_require(`
		type wireshark_t, wireshark_exec_t;
	')

	domtrans_pattern($1, wireshark_exec_t, wireshark_t)
')