1tomcat_selinux(8) SELinux Policy tomcat tomcat_selinux(8)
2
3
4
6 tomcat_selinux - Security Enhanced Linux Policy for the tomcat pro‐
7 cesses
8
10 Security-Enhanced Linux secures the tomcat processes via flexible
11 mandatory access control.
12
13 The tomcat processes execute with the tomcat_t SELinux type. You can
14 check if you have these processes running by executing the ps command
15 with the -Z qualifier.
16
17 For example:
18
19 ps -eZ | grep tomcat_t
20
21
22
24 The tomcat_t SELinux type can be entered via the file_type, unla‐
25 beled_t, proc_type, filesystem_type, mtrr_device_t, tomcat_exec_t,
26 sysctl_type file types.
27
28 The default entrypoint paths for the tomcat_t domain are the following:
29
30 all files on the system, /dev/cpu/mtrr, /usr/sbin/tomcat(6)?
31
33 SELinux defines process types (domains) for each process running on the
34 system
35
36 You can see the context of a process using the -Z option to ps
37
38 Policy governs the access confined processes have to files. SELinux
39 tomcat policy is very flexible allowing users to setup their tomcat
40 processes in as secure a method as possible.
41
42 The following process types are defined for tomcat:
43
44 tomcat_t
45
46 Note: semanage permissive -a tomcat_t can be used to make the process
47 type tomcat_t permissive. SELinux does not deny access to permissive
48 process types, but the AVC (SELinux denials) messages are still gener‐
49 ated.
50
51
53 SELinux policy is customizable based on least access required. tomcat
54 policy is extremely flexible and has several booleans that allow you to
55 manipulate the policy and run tomcat with the tightest access possible.
56
57
58
59 If you want to allow all daemons to write corefiles to /, you must turn
60 on the allow_daemons_dump_core boolean. Disabled by default.
61
62 setsebool -P allow_daemons_dump_core 1
63
64
65
66 If you want to allow all daemons to use tcp wrappers, you must turn on
67 the allow_daemons_use_tcp_wrapper boolean. Disabled by default.
68
69 setsebool -P allow_daemons_use_tcp_wrapper 1
70
71
72
73 If you want to allow all daemons the ability to read/write terminals,
74 you must turn on the allow_daemons_use_tty boolean. Disabled by
75 default.
76
77 setsebool -P allow_daemons_use_tty 1
78
79
80
81 If you want to allow all domains to use other domains file descriptors,
82 you must turn on the allow_domain_fd_use boolean. Enabled by default.
83
84 setsebool -P allow_domain_fd_use 1
85
86
87
88 If you want to allow unconfined executables to make their heap memory
89 executable. Doing this is a really bad idea. Probably indicates a
90 badly coded executable, but could indicate an attack. This executable
91 should be reported in bugzilla, you must turn on the allow_execheap
92 boolean. Disabled by default.
93
94 setsebool -P allow_execheap 1
95
96
97
98 If you want to allow unconfined executables to map a memory region as
99 both executable and writable, this is dangerous and the executable
100 should be reported in bugzilla), you must turn on the allow_execmem
101 boolean. Enabled by default.
102
103 setsebool -P allow_execmem 1
104
105
106
107 If you want to allow all unconfined executables to use libraries
108 requiring text relocation that are not labeled textrel_shlib_t), you
109 must turn on the allow_execmod boolean. Enabled by default.
110
111 setsebool -P allow_execmod 1
112
113
114
115 If you want to allow unconfined executables to make their stack exe‐
116 cutable. This should never, ever be necessary. Probably indicates a
117 badly coded executable, but could indicate an attack. This executable
118 should be reported in bugzilla), you must turn on the allow_execstack
119 boolean. Enabled by default.
120
121 setsebool -P allow_execstack 1
122
123
124
125 If you want to allow sysadm to debug or ptrace all processes, you must
126 turn on the allow_ptrace boolean. Disabled by default.
127
128 setsebool -P allow_ptrace 1
129
130
131
132 If you want to enable cluster mode for daemons, you must turn on the
133 daemons_enable_cluster_mode boolean. Disabled by default.
134
135 setsebool -P daemons_enable_cluster_mode 1
136
137
138
139 If you want to allow all domains to have the kernel load modules, you
140 must turn on the domain_kernel_load_modules boolean. Disabled by
141 default.
142
143 setsebool -P domain_kernel_load_modules 1
144
145
146
147 If you want to allow all domains to execute in fips_mode, you must turn
148 on the fips_mode boolean. Enabled by default.
149
150 setsebool -P fips_mode 1
151
152
153
154 If you want to enable reading of urandom for all domains, you must turn
155 on the global_ssp boolean. Disabled by default.
156
157 setsebool -P global_ssp 1
158
159
160
161 If you want to enable support for upstart as the init program, you must
162 turn on the init_upstart boolean. Enabled by default.
163
164 setsebool -P init_upstart 1
165
166
167
168 If you want to allow certain domains to map low memory in the kernel,
169 you must turn on the mmap_low_allowed boolean. Disabled by default.
170
171 setsebool -P mmap_low_allowed 1
172
173
174
175 If you want to boolean to determine whether the system permits loading
176 policy, setting enforcing mode, and changing boolean values. Set this
177 to true and you have to reboot to set it back, you must turn on the
178 secure_mode_policyload boolean. Disabled by default.
179
180 setsebool -P secure_mode_policyload 1
181
182
183
184 If you want to support X userspace object manager, you must turn on the
185 xserver_object_manager boolean. Disabled by default.
186
187 setsebool -P xserver_object_manager 1
188
189
190
192 The SELinux process type tomcat_t can manage files labeled with the
193 following file types. The paths listed are the default paths for these
194 file types. Note the processes UID still need to have DAC permissions.
195
196 file_type
197
198 all files on the system
199
200
202 SELinux requires files to have an extended attribute to define the file
203 type.
204
205 You can see the context of a file using the -Z option to ls
206
207 Policy governs the access confined processes have to these files.
208 SELinux tomcat policy is very flexible allowing users to setup their
209 tomcat processes in as secure a method as possible.
210
211 STANDARD FILE CONTEXT
212
213 SELinux defines the file context types for the tomcat, if you wanted to
214 store files with these types in a diffent paths, you need to execute
215 the semanage command to sepecify alternate labeling and then use
216 restorecon to put the labels on disk.
217
218 semanage fcontext -a -t tomcat_var_run_t '/srv/mytomcat_content(/.*)?'
219 restorecon -R -v /srv/mytomcat_content
220
221 Note: SELinux often uses regular expressions to specify labels that
222 match multiple files.
223
224 The following file types are defined for tomcat:
225
226
227
228 tomcat_cache_t
229
230 - Set files with the tomcat_cache_t type, if you want to store the
231 files under the /var/cache directory.
232
233
234
235 tomcat_exec_t
236
237 - Set files with the tomcat_exec_t type, if you want to transition an
238 executable to the tomcat_t domain.
239
240
241
242 tomcat_log_t
243
244 - Set files with the tomcat_log_t type, if you want to treat the data
245 as tomcat log data, usually stored under the /var/log directory.
246
247
248
249 tomcat_tmp_t
250
251 - Set files with the tomcat_tmp_t type, if you want to store tomcat
252 temporary files in the /tmp directories.
253
254
255
256 tomcat_var_lib_t
257
258 - Set files with the tomcat_var_lib_t type, if you want to store the
259 tomcat files under the /var/lib directory.
260
261
262
263 tomcat_var_run_t
264
265 - Set files with the tomcat_var_run_t type, if you want to store the
266 tomcat files under the /run or /var/run directory.
267
268
269
270 Note: File context can be temporarily modified with the chcon command.
271 If you want to permanently change the file context you need to use the
272 semanage fcontext command. This will modify the SELinux labeling data‐
273 base. You will need to use restorecon to apply the labels.
274
275
277 semanage fcontext can also be used to manipulate default file context
278 mappings.
279
280 semanage permissive can also be used to manipulate whether or not a
281 process type is permissive.
282
283 semanage module can also be used to enable/disable/install/remove pol‐
284 icy modules.
285
286 semanage boolean can also be used to manipulate the booleans
287
288
289 system-config-selinux is a GUI tool available to customize SELinux pol‐
290 icy settings.
291
292
294 This manual page was auto-generated using sepolicy manpage .
295
296
298 selinux(8), tomcat(8), semanage(8), restorecon(8), chcon(1) , setse‐
299 bool(8)
300
301
302
303tomcat 15-06-03 tomcat_selinux(8)