1tor_selinux(8)                SELinux Policy tor                tor_selinux(8)
2
3
4

NAME

6       tor_selinux - Security Enhanced Linux Policy for the tor processes
7

DESCRIPTION

9       Security-Enhanced  Linux  secures the tor processes via flexible manda‐
10       tory access control.
11
12       The tor processes execute with the tor_t SELinux type. You can check if
13       you  have  these processes running by executing the ps command with the
14       -Z qualifier.
15
16       For example:
17
18       ps -eZ | grep tor_t
19
20
21

ENTRYPOINTS

23       The tor_t SELinux type can be entered via the tor_exec_t file type.
24
25       The default entrypoint paths for the tor_t domain are the following:
26
27       /usr/bin/tor, /usr/sbin/tor
28

PROCESS TYPES

30       SELinux defines process types (domains) for each process running on the
31       system
32
33       You can see the context of a process using the -Z option to ps
34
35       Policy  governs  the  access confined processes have to files.  SELinux
36       tor policy is very flexible allowing users to setup their tor processes
37       in as secure a method as possible.
38
39       The following process types are defined for tor:
40
41       tor_t
42
43       Note: semanage permissive -a tor_t can be used to make the process type
44       tor_t permissive. SELinux does not deny access  to  permissive  process
45       types, but the AVC (SELinux denials) messages are still generated.
46
47

BOOLEANS

49       SELinux  policy  is  customizable  based on least access required.  tor
50       policy is extremely flexible and has several booleans that allow you to
51       manipulate the policy and run tor with the tightest access possible.
52
53
54
55       If  you want to determine whether tor can bind tcp sockets to all unre‐
56       served ports, you must turn on the tor_bind_all_unreserved_ports  bool‐
57       ean. Disabled by default.
58
59       setsebool -P tor_bind_all_unreserved_ports 1
60
61
62
63       If  you  want  to  allow  tor  to  act as a relay, you must turn on the
64       tor_can_network_relay boolean. Disabled by default.
65
66       setsebool -P tor_can_network_relay 1
67
68
69
70       If you want to allow users to resolve user passwd entries directly from
71       ldap  rather  then  using  a  sssd server, you must turn on the authlo‐
72       gin_nsswitch_use_ldap boolean. Disabled by default.
73
74       setsebool -P authlogin_nsswitch_use_ldap 1
75
76
77
78       If you want to allow all daemons to write corefiles to /, you must turn
79       on the daemons_dump_core boolean. Disabled by default.
80
81       setsebool -P daemons_dump_core 1
82
83
84
85       If  you  want  to enable cluster mode for daemons, you must turn on the
86       daemons_enable_cluster_mode boolean. Enabled by default.
87
88       setsebool -P daemons_enable_cluster_mode 1
89
90
91
92       If you want to allow all daemons to use tcp wrappers, you must turn  on
93       the daemons_use_tcp_wrapper boolean. Disabled by default.
94
95       setsebool -P daemons_use_tcp_wrapper 1
96
97
98
99       If  you  want to allow all daemons the ability to read/write terminals,
100       you must turn on the daemons_use_tty boolean. Disabled by default.
101
102       setsebool -P daemons_use_tty 1
103
104
105
106       If you want to deny any process from ptracing or  debugging  any  other
107       processes,  you  must  turn  on  the  deny_ptrace  boolean.  Enabled by
108       default.
109
110       setsebool -P deny_ptrace 1
111
112
113
114       If you want to allow any process  to  mmap  any  file  on  system  with
115       attribute  file_type,  you must turn on the domain_can_mmap_files bool‐
116       ean. Enabled by default.
117
118       setsebool -P domain_can_mmap_files 1
119
120
121
122       If you want to allow all domains write to kmsg_device, while kernel  is
123       executed  with  systemd.log_target=kmsg parameter, you must turn on the
124       domain_can_write_kmsg boolean. Disabled by default.
125
126       setsebool -P domain_can_write_kmsg 1
127
128
129
130       If you want to allow all domains to use other domains file descriptors,
131       you must turn on the domain_fd_use boolean. Enabled by default.
132
133       setsebool -P domain_fd_use 1
134
135
136
137       If  you  want to allow all domains to have the kernel load modules, you
138       must  turn  on  the  domain_kernel_load_modules  boolean.  Disabled  by
139       default.
140
141       setsebool -P domain_kernel_load_modules 1
142
143
144
145       If you want to allow all domains to execute in fips_mode, you must turn
146       on the fips_mode boolean. Enabled by default.
147
148       setsebool -P fips_mode 1
149
150
151
152       If you want to enable reading of urandom for all domains, you must turn
153       on the global_ssp boolean. Disabled by default.
154
155       setsebool -P global_ssp 1
156
157
158
159       If  you  want  to allow confined applications to run with kerberos, you
160       must turn on the kerberos_enabled boolean. Enabled by default.
161
162       setsebool -P kerberos_enabled 1
163
164
165
166       If you want to allow system to run with  NIS,  you  must  turn  on  the
167       nis_enabled boolean. Disabled by default.
168
169       setsebool -P nis_enabled 1
170
171
172
173       If  you  want to allow confined applications to use nscd shared memory,
174       you must turn on the nscd_use_shm boolean. Disabled by default.
175
176       setsebool -P nscd_use_shm 1
177
178
179

PORT TYPES

181       SELinux defines port types to represent TCP and UDP ports.
182
183       You can see the types associated with a port  by  using  the  following
184       command:
185
186       semanage port -l
187
188
189       Policy  governs  the  access  confined  processes  have to these ports.
190       SELinux tor policy is very flexible allowing users to setup  their  tor
191       processes in as secure a method as possible.
192
193       The following port types are defined for tor:
194
195
196       tor_port_t
197
198
199
200       Default Defined Ports:
201                 tcp 6969,9001,9030,9050,9051,9150
202

MANAGED FILES

204       The  SELinux  process type tor_t can manage files labeled with the fol‐
205       lowing file types.  The paths listed are the default  paths  for  these
206       file types.  Note the processes UID still need to have DAC permissions.
207
208       cluster_conf_t
209
210            /etc/cluster(/.*)?
211
212       cluster_var_lib_t
213
214            /var/lib/pcsd(/.*)?
215            /var/lib/cluster(/.*)?
216            /var/lib/openais(/.*)?
217            /var/lib/pengine(/.*)?
218            /var/lib/corosync(/.*)?
219            /usr/lib/heartbeat(/.*)?
220            /var/lib/heartbeat(/.*)?
221            /var/lib/pacemaker(/.*)?
222
223       cluster_var_run_t
224
225            /var/run/crm(/.*)?
226            /var/run/cman_.*
227            /var/run/rsctmp(/.*)?
228            /var/run/aisexec.*
229            /var/run/heartbeat(/.*)?
230            /var/run/corosync-qnetd(/.*)?
231            /var/run/corosync-qdevice(/.*)?
232            /var/run/cpglockd.pid
233            /var/run/corosync.pid
234            /var/run/rgmanager.pid
235            /var/run/cluster/rgmanager.sk
236
237       root_t
238
239            /sysroot/ostree/deploy/.*-atomic.*/deploy(/.*)?
240            /
241            /initrd
242
243       tor_var_lib_t
244
245            /var/lib/tor(/.*)?
246            /var/lib/tor-data(/.*)?
247
248       tor_var_run_t
249
250            /var/run/tor(/.*)?
251
252

FILE CONTEXTS

254       SELinux requires files to have an extended attribute to define the file
255       type.
256
257       You can see the context of a file using the -Z option to ls
258
259       Policy governs the access  confined  processes  have  to  these  files.
260       SELinux  tor  policy is very flexible allowing users to setup their tor
261       processes in as secure a method as possible.
262
263       EQUIVALENCE DIRECTORIES
264
265
266       tor policy stores data with multiple different file context types under
267       the  /var/lib/tor  directory.  If you would like to store the data in a
268       different directory you can use  the  semanage  command  to  create  an
269       equivalence  mapping.   If you wanted to store this data under the /srv
270       dirctory you would execute the following command:
271
272       semanage fcontext -a -e /var/lib/tor /srv/tor
273       restorecon -R -v /srv/tor
274
275       STANDARD FILE CONTEXT
276
277       SELinux defines the file context types for the tor, if  you  wanted  to
278       store  files  with  these types in a diffent paths, you need to execute
279       the semanage command  to  sepecify  alternate  labeling  and  then  use
280       restorecon to put the labels on disk.
281
282       semanage fcontext -a -t tor_var_run_t '/srv/mytor_content(/.*)?'
283       restorecon -R -v /srv/mytor_content
284
285       Note:  SELinux  often  uses  regular expressions to specify labels that
286       match multiple files.
287
288       The following file types are defined for tor:
289
290
291
292       tor_etc_t
293
294       - Set files with the tor_etc_t type, if you want to store tor files  in
295       the /etc directories.
296
297
298
299       tor_exec_t
300
301       - Set files with the tor_exec_t type, if you want to transition an exe‐
302       cutable to the tor_t domain.
303
304
305       Paths:
306            /usr/bin/tor, /usr/sbin/tor
307
308
309       tor_initrc_exec_t
310
311       - Set files with the tor_initrc_exec_t type, if you want to  transition
312       an executable to the tor_initrc_t domain.
313
314
315
316       tor_unit_file_t
317
318       -  Set  files  with  the tor_unit_file_t type, if you want to treat the
319       files as tor unit content.
320
321
322
323       tor_var_lib_t
324
325       - Set files with the tor_var_lib_t type, if you want to store  the  tor
326       files under the /var/lib directory.
327
328
329       Paths:
330            /var/lib/tor(/.*)?, /var/lib/tor-data(/.*)?
331
332
333       tor_var_log_t
334
335       -  Set files with the tor_var_log_t type, if you want to treat the data
336       as tor var log data, usually stored under the /var/log directory.
337
338
339
340       tor_var_run_t
341
342       - Set files with the tor_var_run_t type, if you want to store  the  tor
343       files under the /run or /var/run directory.
344
345
346
347       Note:  File context can be temporarily modified with the chcon command.
348       If you want to permanently change the file context you need to use  the
349       semanage fcontext command.  This will modify the SELinux labeling data‐
350       base.  You will need to use restorecon to apply the labels.
351
352

COMMANDS

354       semanage fcontext can also be used to manipulate default  file  context
355       mappings.
356
357       semanage  permissive  can  also  be used to manipulate whether or not a
358       process type is permissive.
359
360       semanage module can also be used to enable/disable/install/remove  pol‐
361       icy modules.
362
363       semanage port can also be used to manipulate the port definitions
364
365       semanage boolean can also be used to manipulate the booleans
366
367
368       system-config-selinux is a GUI tool available to customize SELinux pol‐
369       icy settings.
370
371

AUTHOR

373       This manual page was auto-generated using sepolicy manpage .
374
375

SEE ALSO

377       selinux(8), tor(8), semanage(8), restorecon(8), chcon(1), sepolicy(8) ,
378       setsebool(8)
379
380
381
382tor                                19-04-25                     tor_selinux(8)
Impressum