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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
|
policy_module(java, 2.11.1)
########################################
#
# Declarations
#
## <desc>
## <p>
## Determine whether java can make
## its stack executable.
## </p>
## </desc>
gen_tunable(allow_java_execstack, false)
attribute java_domain;
attribute_role java_roles;
roleattribute system_r java_roles;
attribute_role unconfined_java_roles;
type java_t, java_domain;
type java_exec_t;
userdom_user_application_domain(java_t, java_exec_t)
typealias java_t alias { staff_javaplugin_t user_javaplugin_t sysadm_javaplugin_t };
typealias java_t alias { auditadm_javaplugin_t secadm_javaplugin_t };
role java_roles types java_t;
optional_policy(`
wm_application_domain(java_t, java_exec_t)
')
type java_home_t;
userdom_user_home_content(java_home_t)
type java_tmp_t;
userdom_user_tmp_file(java_tmp_t)
typealias java_tmp_t alias { staff_javaplugin_tmp_t user_javaplugin_tmp_t sysadm_javaplugin_tmp_t };
typealias java_tmp_t alias { auditadm_tmp_javaplugin_t secadm_javaplugin_tmp_t };
type java_tmpfs_t;
userdom_user_tmpfs_file(java_tmpfs_t)
typealias java_tmpfs_t alias { staff_javaplugin_tmpfs_t user_javaplugin_tmpfs_t sysadm_javaplugin_tmpfs_t };
typealias java_tmpfs_t alias { auditadm_tmpfs_javaplugin_t secadm_tmpfs_javaplugin_t };
type unconfined_java_t;
init_system_domain(unconfined_java_t, java_exec_t)
role unconfined_java_roles types unconfined_java_t;
########################################
#
# Common local policy
#
allow java_domain self:process { signal_perms getsched setsched };
allow java_domain self:fifo_file rw_fifo_file_perms;
manage_dirs_pattern(java_domain, java_home_t, java_home_t)
manage_files_pattern(java_domain, java_home_t, java_home_t)
userdom_user_home_dir_filetrans(java_domain, java_home_t, dir, ".java")
manage_dirs_pattern(java_domain, java_tmp_t, java_tmp_t)
manage_files_pattern(java_domain, java_tmp_t, java_tmp_t)
files_tmp_filetrans(java_domain, java_tmp_t, { file dir })
manage_files_pattern(java_domain, java_tmpfs_t, java_tmpfs_t)
manage_lnk_files_pattern(java_domain, java_tmpfs_t, java_tmpfs_t)
manage_fifo_files_pattern(java_domain, java_tmpfs_t, java_tmpfs_t)
manage_sock_files_pattern(java_domain, java_tmpfs_t, java_tmpfs_t)
fs_tmpfs_filetrans(java_domain, java_tmpfs_t, { file lnk_file sock_file fifo_file })
can_exec(java_domain, { java_exec_t java_tmp_t })
kernel_read_all_sysctls(java_domain)
kernel_search_vm_sysctl(java_domain)
kernel_read_network_state(java_domain)
kernel_read_system_state(java_domain)
corecmd_search_bin(java_domain)
corenet_all_recvfrom_unlabeled(java_domain)
corenet_all_recvfrom_netlabel(java_domain)
corenet_tcp_sendrecv_generic_if(java_domain)
corenet_tcp_sendrecv_generic_node(java_domain)
corenet_sendrecv_all_client_packets(java_domain)
corenet_tcp_connect_all_ports(java_domain)
corenet_tcp_sendrecv_all_ports(java_domain)
dev_read_sound(java_domain)
dev_write_sound(java_domain)
dev_read_urand(java_domain)
dev_read_rand(java_domain)
dev_dontaudit_append_rand(java_domain)
files_read_usr_files(java_domain)
files_read_etc_files(java_domain)
files_read_etc_runtime_files(java_domain)
fs_getattr_all_fs(java_domain)
fs_dontaudit_rw_tmpfs_files(java_domain)
logging_send_syslog_msg(java_domain)
miscfiles_read_generic_certs(java_domain)
miscfiles_read_localization(java_domain)
miscfiles_read_fonts(java_domain)
userdom_dontaudit_use_user_terminals(java_domain)
userdom_dontaudit_exec_user_home_content_files(java_domain)
userdom_user_content_access_template(java, java_domain)
userdom_write_user_tmp_sockets(java_domain)
tunable_policy(`java_manage_generic_user_content',`
userdom_manage_user_home_content_pipes(java_domain)
userdom_manage_user_home_content_sockets(java_domain)
userdom_user_home_dir_filetrans_user_home_content(java_domain, { file lnk_file sock_file fifo_file })
')
ifdef(`distro_gentoo',`
# For java browser plugin accessing internet resources
allow java_domain self:netlink_route_socket create_netlink_socket_perms;
allow java_domain self:sem create_sem_perms;
manage_dirs_pattern(java_domain, java_home_t, java_home_t)
manage_files_pattern(java_domain, java_home_t, java_home_t)
userdom_user_home_dir_filetrans(java_domain, java_home_t, dir, ".icedtea")
manage_lnk_files_pattern(java_domain, java_tmp_t, java_tmp_t)
files_tmp_filetrans(java_domain, java_tmp_t, lnk_file)
')
tunable_policy(`allow_java_execstack',`
allow java_domain self:process { execmem execstack };
libs_legacy_use_shared_libs(java_domain)
libs_legacy_use_ld_so(java_domain)
miscfiles_legacy_read_localization(java_domain)
')
########################################
#
# Local policy
#
auth_use_nsswitch(java_t)
ifdef(`distro_gentoo',`
userdom_use_user_terminals(java_t)
optional_policy(`
# Plugin communication
chromium_rw_tmp_pipes(java_t)
')
optional_policy(`
# Plugin communication
mozilla_rw_tmp_pipes(java_t)
')
ifdef(`use_alsa',`
optional_policy(`
alsa_domain(java_t, java_tmpfs_t)
')
')
')
corecmd_search_bin(java_t)
dev_read_sysfs(java_t)
locallogin_use_fds(java_t)
userdom_read_user_tmp_files(java_t)
userdom_use_user_terminals(java_t)
optional_policy(`
xserver_user_x_domain_template(java, java_t, java_tmpfs_t)
')
########################################
#
# Unconfined local policy
#
optional_policy(`
allow unconfined_java_t self:process { execstack execmem execheap };
files_execmod_all_files(unconfined_java_t)
init_dbus_chat_script(unconfined_java_t)
unconfined_domain_noaudit(unconfined_java_t)
unconfined_dbus_chat(unconfined_java_t)
optional_policy(`
rpm_domtrans(unconfined_java_t)
')
')
|