1tor_selinux(8) SELinux Policy tor tor_selinux(8)
2
3
4
6 tor_selinux - Security Enhanced Linux Policy for the tor processes
7
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
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
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
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 and udp sockets to
56 all unreserved ports, you must turn on the tor_bind_all_unre‐
57 served_ports boolean. 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 dontaudit all daemons scheduling requests (setsched,
71 sys_nice), you must turn on the daemons_dontaudit_scheduling boolean.
72 Enabled by default.
73
74 setsebool -P daemons_dontaudit_scheduling 1
75
76
77
78 If you want to allow all domains to execute in fips_mode, you must turn
79 on the fips_mode boolean. Enabled by default.
80
81 setsebool -P fips_mode 1
82
83
84
85 If you want to allow system to run with NIS, you must turn on the
86 nis_enabled boolean. Disabled by default.
87
88 setsebool -P nis_enabled 1
89
90
91
93 SELinux defines port types to represent TCP and UDP ports.
94
95 You can see the types associated with a port by using the following
96 command:
97
98 semanage port -l
99
100
101 Policy governs the access confined processes have to these ports.
102 SELinux tor policy is very flexible allowing users to setup their tor
103 processes in as secure a method as possible.
104
105 The following port types are defined for tor:
106
107
108 tor_port_t
109
110
111
112 Default Defined Ports:
113 tcp 6969,9001,9030,9050,9051,9150
114
116 The SELinux process type tor_t can manage files labeled with the fol‐
117 lowing file types. The paths listed are the default paths for these
118 file types. Note the processes UID still need to have DAC permissions.
119
120 cluster_conf_t
121
122 /etc/cluster(/.*)?
123
124 cluster_var_lib_t
125
126 /var/lib/pcsd(/.*)?
127 /var/lib/cluster(/.*)?
128 /var/lib/openais(/.*)?
129 /var/lib/pengine(/.*)?
130 /var/lib/corosync(/.*)?
131 /usr/lib/heartbeat(/.*)?
132 /var/lib/heartbeat(/.*)?
133 /var/lib/pacemaker(/.*)?
134
135 cluster_var_run_t
136
137 /var/run/crm(/.*)?
138 /var/run/cman_.*
139 /var/run/rsctmp(/.*)?
140 /var/run/aisexec.*
141 /var/run/heartbeat(/.*)?
142 /var/run/pcsd-ruby.socket
143 /var/run/corosync-qnetd(/.*)?
144 /var/run/corosync-qdevice(/.*)?
145 /var/run/corosync.pid
146 /var/run/cpglockd.pid
147 /var/run/rgmanager.pid
148 /var/run/cluster/rgmanager.sk
149
150 krb5_host_rcache_t
151
152 /var/tmp/krb5_0.rcache2
153 /var/cache/krb5rcache(/.*)?
154 /var/tmp/nfs_0
155 /var/tmp/DNS_25
156 /var/tmp/host_0
157 /var/tmp/imap_0
158 /var/tmp/HTTP_23
159 /var/tmp/HTTP_48
160 /var/tmp/ldap_55
161 /var/tmp/ldap_487
162 /var/tmp/ldapmap1_0
163
164 root_t
165
166 /sysroot/ostree/deploy/.*-atomic/deploy(/.*)?
167 /
168 /initrd
169
170 tor_var_lib_t
171
172 /var/lib/tor(/.*)?
173 /var/lib/tor-data(/.*)?
174
175 tor_var_run_t
176
177 /var/run/tor(/.*)?
178
179
181 SELinux requires files to have an extended attribute to define the file
182 type.
183
184 You can see the context of a file using the -Z option to ls
185
186 Policy governs the access confined processes have to these files.
187 SELinux tor policy is very flexible allowing users to setup their tor
188 processes in as secure a method as possible.
189
190 EQUIVALENCE DIRECTORIES
191
192
193 tor policy stores data with multiple different file context types under
194 the /var/lib/tor directory. If you would like to store the data in a
195 different directory you can use the semanage command to create an
196 equivalence mapping. If you wanted to store this data under the /srv
197 directory you would execute the following command:
198
199 semanage fcontext -a -e /var/lib/tor /srv/tor
200 restorecon -R -v /srv/tor
201
202 STANDARD FILE CONTEXT
203
204 SELinux defines the file context types for the tor, if you wanted to
205 store files with these types in a different paths, you need to execute
206 the semanage command to specify alternate labeling and then use re‐
207 storecon to put the labels on disk.
208
209 semanage fcontext -a -t tor_exec_t '/srv/tor/content(/.*)?'
210 restorecon -R -v /srv/mytor_content
211
212 Note: SELinux often uses regular expressions to specify labels that
213 match multiple files.
214
215 The following file types are defined for tor:
216
217
218
219 tor_etc_t
220
221 - Set files with the tor_etc_t type, if you want to store tor files in
222 the /etc directories.
223
224
225
226 tor_exec_t
227
228 - Set files with the tor_exec_t type, if you want to transition an exe‐
229 cutable to the tor_t domain.
230
231
232 Paths:
233 /usr/bin/tor, /usr/sbin/tor
234
235
236 tor_initrc_exec_t
237
238 - Set files with the tor_initrc_exec_t type, if you want to transition
239 an executable to the tor_initrc_t domain.
240
241
242
243 tor_unit_file_t
244
245 - Set files with the tor_unit_file_t type, if you want to treat the
246 files as tor unit content.
247
248
249
250 tor_var_lib_t
251
252 - Set files with the tor_var_lib_t type, if you want to store the tor
253 files under the /var/lib directory.
254
255
256 Paths:
257 /var/lib/tor(/.*)?, /var/lib/tor-data(/.*)?
258
259
260 tor_var_log_t
261
262 - Set files with the tor_var_log_t type, if you want to treat the data
263 as tor var log data, usually stored under the /var/log directory.
264
265
266
267 tor_var_run_t
268
269 - Set files with the tor_var_run_t type, if you want to store the tor
270 files under the /run or /var/run directory.
271
272
273
274 Note: File context can be temporarily modified with the chcon command.
275 If you want to permanently change the file context you need to use the
276 semanage fcontext command. This will modify the SELinux labeling data‐
277 base. You will need to use restorecon to apply the labels.
278
279
281 semanage fcontext can also be used to manipulate default file context
282 mappings.
283
284 semanage permissive can also be used to manipulate whether or not a
285 process type is permissive.
286
287 semanage module can also be used to enable/disable/install/remove pol‐
288 icy modules.
289
290 semanage port can also be used to manipulate the port definitions
291
292 semanage boolean can also be used to manipulate the booleans
293
294
295 system-config-selinux is a GUI tool available to customize SELinux pol‐
296 icy settings.
297
298
300 This manual page was auto-generated using sepolicy manpage .
301
302
304 selinux(8), tor(8), semanage(8), restorecon(8), chcon(1), sepolicy(8),
305 setsebool(8)
306
307
308
309tor 23-10-20 tor_selinux(8)