Backport from trunk:
[libradsec.git] / radsecproxy.conf.5
1 '\" -*- coding: us-ascii -*-
2 .if \n(.g .ds T< \\FC
3 .if \n(.g .ds T> \\F[\n[.fam]]
4 .de URL
5 \\$2 \(la\\$1\(ra\\$3
6 ..
7 .if \n(.g .mso www.tmac
8 .TH "radsecproxy.conf " 5 2009-07-22 "radsecproxy 1.3.1" ""
9 .SH NAME
10 radsecproxy.conf
11 \- Radsec proxy configuration file 
12 .SH DESCRIPTION
13 When the proxy server starts, it will first check the command line arguments,
14 and then read the configuration file. Normally radsecproxy will read the
15 configuration file \*(T<\fI/etc/radsecproxy.conf\fR\*(T>. The command
16 line \*(T<\fB\-c\fR\*(T> option can be used to instead read an alternate
17 file (see
18 \fBradsecproxy\fR(1)
19 for details).
20 .PP
21 If the configuration file can not be found, the proxy will exit with an
22 error message. Note that there is also an include facility so that any
23 configuration file may include other configuration files. The proxy will
24 also exit on configuration errors.
25 .SH "CONFIGURATION SYNTAX"
26 When the configuration file is processed, whitespace (spaces and tabs) are
27 generally ignored. For each line, leading and trailing whitespace are ignored.
28 A line is ignored if it is empty, only consists of whitespace, or if the first 
29 non-whitespace character is a \*(T<#\*(T>. The configuration is
30 generally case insensitive, but in some cases the option values (see below)
31 are not.
32 .PP
33 There are two types of configuration structures than can be used. The first
34 and simplest are lines of the format \fIoption value\fR. That
35 is, an option name, see below for a list of valid options, followed by
36 whitespace (at least one space or tab character), followed by a value. Note
37 that if the value contains whitespace, then it must be quoted using
38 \*(T<""\*(T> or \*(T<''\*(T>. Any whitespace
39 in front of the option or after the value will be ignored.
40 .PP
41 The other type of structure is a block. A block spans at least two lines, and
42 has the format:
43 .RS 
44 .nf
45
46 blocktype name {
47     option value
48     option value
49     ...
50 }
51 .fi
52 .RE
53
54 That is, some blocktype, see below for a list of the different block types, and
55 then enclosed in braces you have zero or more lines that each have the
56 previously described \fIoption value\fR format. Different block
57 types have different rules for which options can be specified, they are listed
58 below. The rules regarding white space, comments and quotes are as above. Hence
59 you may do things like:
60 .RS 
61 .nf
62
63 blocktype name {
64 #    option value
65     option "value with space"
66     ...
67 }
68 .fi
69 .RE
70 .PP
71 Option value characters can also be written in hex. This is done by writing the
72 character \*(T<%\*(T> followed by two hexadecimal digits. If a
73 \*(T<%\*(T> is used without two following hexadecimal digits, the
74 \*(T<%\*(T> and the following characters are used as written. If you
75 want to write a \*(T<%\*(T> and not use this decoding, you may of
76 course write \*(T<%\*(T> in hex; i.e., \*(T<%25\*(T>.
77 .PP
78 There is one special option that can be used both as a basic option and inside
79 all blocks. That is the option \*(T<include\*(T> where the value
80 specifies files to be included. The value can be a single file, or it can use
81 normal shell globbing to specify multiple files, e.g.:
82 .RS 
83 include /etc/radsecproxy.conf.d/*.conf
84 .RE
85
86 The files are sorted alphabetically. Included files are read in the order they
87 are specified, when reaching the end of a file, the next file is read. When
88 reaching the end of the last included file, the proxy returns to read the next
89 line following the \*(T<include\*(T> option. Included files may again
90 include other files.
91 .SH "BASIC OPTIONS"
92 The following basic options may be specified in the configuration file. Note
93 that blocktypes and options inside blocks are discussed later. Note that none
94 of these options are required, and indeed in many cases they are not needed.
95 Note that you should specify each at most once. The behaviour with multiple
96 occurences is undefined.
97 .TP 
98 \*(T<logLevel\*(T>
99 This option specifies the debug level. It must be set to 1, 2, 3 or 4, where 1
100 logs only serious errors, and 4 logs everything. The default is 2 which logs
101 errors, warnings and a few informational messages. Note that the command line
102 option \*(T<\fB\-d\fR\*(T> overrides this.
103 .TP 
104 \*(T<logDestination\*(T>
105 This specifies where the log messages should go. By default the messages go to
106 syslog with facility \*(T<LOG_DAEMON\*(T>. Using this option you can
107 specify another syslog facility, or you may specify that logging should be to
108 a particular file, not using syslog. The value must be either a file or
109 syslog URL. The file URL is the standard one, specifying a local file that
110 should be used. For syslog, you must use the syntax:
111 \*(T<x\-syslog:///FACILITY\*(T> where \*(T<FACILITY\*(T> must
112 be one of \*(T<LOG_DAEMON\*(T>, \*(T<LOG_MAIL\*(T>,
113 \*(T<LOG_USER\*(T>, \*(T<LOG_LOCAL0\*(T>,
114 \*(T<LOG_LOCAL1\*(T>, \*(T<LOG_LOCAL2\*(T>,
115 \*(T<LOG_LOCAL3\*(T>, \*(T<LOG_LOCAL4\*(T>,
116 \*(T<LOG_LOCAL5\*(T>, \*(T<LOG_LOCAL6\*(T> or
117 \*(T<LOG_LOCAL7\*(T>. You may omit the facility from the URL to
118 specify logging to the default facility, but this is not very useful since
119 this is the default log destination. Note that this option is ignored if
120 \*(T<\fB\-f\fR\*(T> is specified on the command line.
121 .TP 
122 \*(T<listenUDP\*(T>
123 Normally the proxy will listen to the standard RADIUS UDP port
124 \*(T<1812\*(T> if configured to handle UDP clients. On most systems it
125 will do this for all of the system's IP addresses (both IPv4 and IPv6). On some
126 systems however, it may respond to only IPv4 or only IPv6. To specify an
127 alternate port you may use a value of the form \*(T<*:port\*(T> where
128 port is any valid port number. If you also want to specify a specific address
129 you can do e.g. \*(T<192.168.1.1:1812\*(T> or
130 \*(T<[2001:db8::1]:1812\*(T>. The port may be omitted if you want the
131 default one (like in these examples). These examples are equivalent to
132 \*(T<192.168.1.1\*(T> and \*(T<2001:db8::1\*(T>. Note that
133 you must use brackets around the IPv6 address.
134 This option may be specified multiple times to listen to multiple addresses
135 and/or ports.
136 .TP 
137 \*(T<listenTCP\*(T>
138 This option is similar to the \*(T<listenUDP\*(T> option, except
139 that it is used for receiving connections from TCP clients. The default port
140 number is \*(T<1812\*(T>.
141 .TP 
142 \*(T<listenTLS\*(T>
143 This is similar to the \*(T<listenUDP\*(T> option, except that it is
144 used for receiving connections from TLS clients. The default port number is
145 \*(T<2083\*(T>. Note that this option was previously called
146 \*(T<listenTCP\*(T>.
147 .TP 
148 \*(T<listenDTLS\*(T>
149 This is similar to the \*(T<listenUDP\*(T> option, except that it is
150 used for receiving connections from DTLS clients. The default port number is 
151 \*(T<2083\*(T>.
152 .TP 
153 \*(T<sourceUDP\*(T>
154 This can be used to specify source address and/or source port that the proxy
155 will use for sending UDP client messages (e.g. Access Request).
156 .TP 
157 \*(T<sourceTCP\*(T>
158 This can be used to specify source address and/or source port that the proxy
159 will use for TCP connections.
160 .TP 
161 \*(T<sourceTLS\*(T>
162 This can be used to specify source address and/or source port that the proxy
163 will use for TLS connections.
164 .TP 
165 \*(T<sourceDTLS\*(T>
166 This can be used to specify source address and/or source port that the proxy
167 will use for DTLS connections.
168 .TP 
169 \*(T<TTLAttribute\*(T>
170 This can be used to change the default TTL attribute. Only change this if
171 you know what you are doing. The syntax is either a numerical value
172 denoting the TTL attribute, or two numerical values separated by column
173 specifying a vendor attribute, i.e. \*(T<vendorid:attribute\*(T>.
174 .TP 
175 \*(T<addTTL\*(T>
176 If a TTL attribute is present, the proxy will decrement the value and
177 discard the message if zero. Normally the proxy does nothing if no TTL
178 attribute is present. If you use the addTTL option with a value 1-255,
179 the proxy will when forwarding a message with no TTL attribute, add one
180 with the specified value. Note that this option can also be specified
181 for a client/server. It will then override this setting when forwarding
182 a message to that client/server.
183 .TP 
184 \*(T<loopPrevention\*(T>
185 This can be set to \*(T<on\*(T> or \*(T<off\*(T> with
186 \*(T<off\*(T> being the default. When this is enabled, a request
187 will never be sent to a server named the same as the client it was received
188 from. I.e., the names of the client block and the server block are compared.
189 Note that this only gives limited protection against loops.
190 .TP 
191 \*(T<include\*(T>
192 This is not a normal configuration option; it can be specified multiple times.
193 It can both be used as a basic option and inside blocks. For the full
194 description, see the configuration syntax section above.
195 .SH BLOCKS
196 There are five types of blocks, they are \*(T<client\*(T>,
197 \*(T<server\*(T>, \*(T<realm\*(T>, \*(T<tls\*(T>
198 and \*(T<rewrite\*(T>. At least one instance of each of
199 \*(T<client\*(T> and \*(T<realm\*(T> is required. This is
200 necessary for the proxy to do anything useful, and it will exit if not. The
201 \*(T<tls\*(T> block is required if at least one TLS/DTLS client or
202 server is configured. Note that there can be multiple blocks for each type.
203 For each type, the block names should be unique. The behaviour with multiple
204 occurences of the same name for the same block type is undefined. Also note
205 that some block option values may reference a block by name, in which case
206 the block name must be previously defined. Hence the order of the blocks may
207 be significant.
208 .SH "CLIENT BLOCK"
209 The client block is used to configure a client. That is, tell the proxy about a
210 client, and what parameters should be used for that client. The name of the
211 client block must (with one exception, see below) be either the IP address
212 (IPv4 or IPv6) of the client, an IP prefix (IPv4 or IPv6) of the form
213 IpAddress/PrefixLength, or a domain name (FQDN). Note that literal IPv6
214 addresses must be enclosed in brackets.
215 .PP
216 If a domain name is specified, then this will be resolved immediately to all
217 the addresses associated with the name, and the proxy will not care about any
218 possible DNS changes that might occur later. Hence there is no dependency on
219 DNS after startup.
220 .PP
221 When some client later sends a request to the proxy, the proxy will look at the
222 IP address the request comes from, and then go through all the addresses of
223 each of the configured clients (in the order they are defined), to determine
224 which (if any) of the clients this is.
225 .PP
226 In the case of TLS/DTLS, the name of the client must match the FQDN or IP
227 address in the client certificate. Note that this is not required when the
228 client name is an IP prefix.
229 .PP
230 Alternatively one may use the \*(T<host\*(T> option inside a client
231 block. In that case, the value of the \*(T<host\*(T> option is used as
232 above, while the name of the block is only used as a descriptive name for the
233 administrator. The host option may be used multiple times, and can be a mix of
234 addresses, FQDNs and prefixes.
235 .PP
236 The allowed options in a client block are \*(T<host\*(T>,
237 \*(T<type\*(T>, \*(T<secret\*(T>, \*(T<tls\*(T>,
238 \*(T<certificateNameCheck\*(T>,
239 \*(T<matchCertificateAttribute\*(T>,
240 \*(T<duplicateInterval\*(T>, \*(T<addTTL\*(T>,
241 \*(T<rewrite\*(T>, \*(T<rewriteIn\*(T>,
242 \*(T<rewriteOut\*(T> and \*(T<rewriteAttribute\*(T>.
243 We already discussed the
244 \*(T<host\*(T> option. The value of \*(T<type\*(T> must be
245 one of \*(T<udp\*(T>, \*(T<tcp\*(T>, \*(T<tls\*(T>
246 or \*(T<dtls\*(T>. The value of \*(T<secret\*(T> is the
247 shared RADIUS key used with this client. If the secret contains whitespace,
248 the value must be quoted. This option is optional for TLS/DTLS.
249 .PP
250 For a TLS/DTLS client you may also specify the \*(T<tls\*(T> option.
251 The option value must be the name of a previously defined TLS block. If this
252 option is not specified, the TLS block with the name
253 \*(T<defaultClient\*(T> will be used if defined. If not defined, it
254 will try to use the TLS block named \*(T<default\*(T>. If the
255 specified TLS block name does not exist, or the option is not specified and
256 none of the defaults exist, the proxy will exit with an error.
257 .PP
258 For a TLS/DTLS client, the option \*(T<certificateNameCheck\*(T>
259 can be set
260 to \*(T<off\*(T>, to disable the default behaviour of matching CN or
261 SubjectAltName against the specified hostname or IP address.
262 .PP
263 Additional validation of certificate attributes can be done by use of the
264 \*(T<matchCertificateAttribute\*(T> option. Currently one can only do
265 some matching of CN and SubjectAltName. For regexp matching on CN, one can use
266 the value \*(T<CN:/regexp/\*(T>. For SubjectAltName one can only do
267 regexp matching of the URI, this is specified as
268 \*(T<SubjectAltName:URI:/regexp/\*(T>. Note that currently this option
269 can only be specified once in a client block.
270 .PP
271 The \*(T<duplicateInterval\*(T> option can be used to specify for how
272 many seconds duplicate checking should be done. If a proxy receives a new
273 request within a few seconds of a previous one, it may be treated the same if
274 from the same client, with the same authenticator etc. The proxy will then
275 ignore the new request (if it is still processing the previous one), or
276 returned a copy of the previous reply.
277 .PP
278 The \*(T<addTTL\*(T> option is similar to the
279 \*(T<addTTL\*(T> option used in the basic config. See that for
280 details. Any value configured here overrides the basic one when sending
281 messages to this client.
282 .PP
283 The \*(T<rewrite\*(T> option is deprecated. Use
284 \*(T<rewriteIn\*(T> instead.
285 .PP
286 The \*(T<rewriteIn\*(T> option can be used to refer to a rewrite block
287 that specifies certain rewrite operations that should be performed on incoming
288 messages from the client. The rewriting is done before other processing.
289 For details, see the rewrite block text below. Similarly to
290 \*(T<tls\*(T> discussed above, if this option is not used, there is a
291 fallback to using the \*(T<rewrite\*(T> block named
292 \*(T<defaultClient\*(T> if it exists; and if not, a fallback to a
293 block named \*(T<default\*(T>.
294 .PP
295 The \*(T<rewriteOut\*(T> option is used in the same way as
296 \*(T<rewriteIn\*(T>, except that it specifies rewrite operations that
297 should be performed on outgoing messages to the client. The rewriting is done
298 after other processing. Also, there is no rewrite fallback if this option is
299 not used.
300 .PP
301 The \*(T<rewriteAttribute\*(T> option currently makes it possible to
302 specify that the User-Name attribute in a client request shall be rewritten in
303 the request sent by the proxy. The User-Name attribute is written back to the
304 original value if a matching response is later sent back to the client. The
305 value must be of the form User-Name:/regexpmatch/replacement/. Example usage:
306 .RS 
307 rewriteAttribute User-Name:/^(.*)@local$/$1@example.com/
308 .RE
309 .SH "SERVER BLOCK"
310 The server block is used to configure a server. That is, tell the proxy about a
311 server, and what parameters should be used when communicating with that server.
312 The name of the server block must (with one exception, see below) be either the
313 IP address (IPv4 or IPv6) of the server, or a domain name (FQDN). If a domain
314 name is specified, then this will be resolved immediately to all the addresses
315 associated with the name, and the proxy will not care about any possible DNS
316 changes that might occur later. Hence there is no dependency on DNS after
317 startup. If the domain name resolves to multiple addresses, then for UDP/DTLS
318 the first address is used. For TCP/TLS, the proxy will loop through the
319 addresses until it can connect to one of them. In the case of TLS/DTLS, the
320 name of the server must match the FQDN or IP address in the server certificate.
321 .PP
322 Alternatively one may use the \*(T<host\*(T> option inside a server
323 block. In that case, the value of the \*(T<host\*(T> option is used as
324 above, while the name of the block is only used as a descriptive name for the
325 administrator. Note that multiple host options may be used. This will then be
326 treated as multiple names/addresses for the same server. When initiating a TCP/TLS
327 connection, all addresses of all names may be attempted, but there is no failover
328 between the different host values. For failover one must use separate server
329 blocks.
330 .PP
331 Note that the name of the block, or values of host options may include a
332 port number (separated with a column). This port number will then override the
333 default port or a port option in the server block. Also note that literal IPv6
334 addresses must be enclosed in brackets.
335 .PP
336 The allowed options in a server block are \*(T<host\*(T>,
337 \*(T<port\*(T>, \*(T<type\*(T>, \*(T<secret\*(T>,
338 \*(T<tls\*(T>, \*(T<certificateNameCheck\*(T>,
339 \*(T<matchCertificateAttribute\*(T>, \*(T<addTTL\*(T>,
340 \*(T<rewrite\*(T>,
341 \*(T<rewriteIn\*(T>, \*(T<rewriteOut\*(T>,
342 \*(T<statusServer\*(T>, \*(T<retryCount\*(T>,
343 \*(T<retryInterval\*(T> and \*(T<dynamicLookupCommand\*(T>.
344 .PP
345 We already discussed the \*(T<host\*(T> option. The
346 \*(T<port\*(T> option allows you to specify which port number the
347 server uses. The usage of \*(T<type\*(T>, \*(T<secret\*(T>,
348 \*(T<tls\*(T>, \*(T<certificateNameCheck\*(T>,
349 \*(T<matchCertificateAttribute\*(T>, \*(T<addTTL\*(T>,
350 \*(T<rewrite\*(T>,
351 \*(T<rewriteIn\*(T> and \*(T<rewriteOut\*(T> are just as
352 specified for the \*(T<client block\*(T> above, except that
353 \*(T<defaultServer\*(T> (and not \*(T<defaultClient\*(T>)
354 is the fallback for the \*(T<tls\*(T>, \*(T<rewrite\*(T>
355 and \*(T<rewriteIn\*(T> options.
356 .PP
357 \*(T<statusServer\*(T> can be specified to enable the use of
358 status-server messages for this server. The value must be either
359 \*(T<on\*(T> or \*(T<off\*(T>. The default when not
360 specified, is \*(T<off\*(T>. If statusserver is enabled, the proxy
361 will during idle periods send regular status-server messages to the server
362 to verify that it is alive. This should only be enabled if the server
363 supports it.
364 .PP
365 The options \*(T<retryCount\*(T> and
366 \*(T<retryInterval\*(T> can be used to specify how many times the
367 proxy should retry sending a request and how long it should wait between each
368 retry. The defaults are 2 retries and an interval of 5s.
369 .PP
370 The option \*(T<dynamicLookupCommand\*(T> can be used to specify a
371 command that should be executed to dynamically configure and use a server.
372 The use of this feature will be documented separately/later.
373 .SH "REALM BLOCK"
374 When the proxy receives an Access-Request it needs to figure out to which
375 server it should be forwarded. This is done by looking at the Username attribute
376 in the request, and matching that against the names of the defined realm blocks.
377 The proxy will match against the blocks in the order they are specified, using
378 the first match if any. If no realm matches, the proxy will simply ignore the
379 request. Each realm block specifies what the server should do when a match is
380 found. A realm block may contain none, one or multiple \*(T<server\*(T>
381 options, and similarly \*(T<accountingServer\*(T> options. There are
382 also \*(T<replyMessage\*(T> and \*(T<accountingResponse\*(T>
383 options. We will discuss these later.
384 .SS "REALM BLOCK NAMES AND MATCHING"
385 In the general case the proxy will look for a \*(T<@\*(T> in the
386 username attribute, and try to do an exact case insensitive match between what
387 comes after the \*(T<@\*(T> and the name of the realm block. So if you
388 get a request with the attribute value \*(T<anonymous@example.com\*(T>,
389 the proxy will go through the realm names in the order they are specified,
390 looking for a realm block named \*(T<example.com\*(T>.
391 .PP
392 There are two exceptions to this, one is the realm name \*(T<*\*(T>
393 which means match everything. Hence if you have a realm block named
394 \*(T<*\*(T>, then it will always match. This should then be the last
395 realm block defined, since any blocks after this would never be checked. This
396 is useful for having a default.
397 .PP
398 The other exception is regular expression matching. If the realm name starts
399 with a \*(T</\*(T>, the name is treated as an regular expression. A
400 case insensitive regexp match will then be done using this regexp on the value
401 of the entire Username attribute. Optionally you may also have a trailing
402 \*(T</\*(T> after the regexp. So as an example, if you want to use
403 regexp matching the domain \*(T<example.com\*(T> you could have a
404 realm block named \*(T</@example\e\e.com$\*(T>. Optinally this can also
405 be written \*(T</@example\e\e.com$/\*(T>. If you want to match all
406 domains under the \*(T<.com\*(T> top domain, you could do
407 \*(T</@.*\e\e.com$\*(T>. Note that since the matching is done on the
408 entire attribute value, you can also use rules like
409 \*(T</^[a\-k].*@example\e\e.com$/\*(T> to get some of the users in this
410 domain to use one server, while other users could be matched by another realm
411 block and use another server.
412 .SS "REALM BLOCK OPTIONS"
413 A realm block may contain none, one or multiple \*(T<server\*(T>
414 options. If defined, the values of the \*(T<server\*(T> options must
415 be the names of previously defined server blocks. Normally requests will be
416 forwarded to the first server option defined. If there are multiple server
417 options, the proxy will do fail-over and use the second server if the first
418 is down. If the two first are down, it will try the third etc. If say the
419 first server comes back up, it will go back to using that one. Currently
420 detection of servers being up or down is based on the use of StatusServer (if
421 enabled), and that TCP/TLS/DTLS connections are up.
422 .PP
423 A realm block may also contain none, one or multiple
424 \*(T<accountingServer\*(T> options. This is used exactly like the
425 \*(T<server\*(T> option, except that it is used for specifying where
426 to send matching accounting requests. The values must be the names of
427 previously defined server blocks. When multiple accounting servers are
428 defined, there is a failover mechanism similar to the one for the
429 \*(T<server\*(T> option.
430 .PP
431 If there is no \*(T<server\*(T> option, the proxy will if
432 \*(T<replyMessage\*(T> is specified, reply back to the client with
433 an Access Reject message. The message contains a replyMessage attribute with
434 the value as specified by the \*(T<replyMessage\*(T> option. Note
435 that this is different from having no match since then the request is simply
436 ignored. You may wonder why this is useful. One example is if you handle say
437 all domains under say \*(T<.bv\*(T>. Then you may have several realm
438 blocks matching the domains that exists, while for other domains under
439 \*(T<\&.bv\*(T> you want to send a reject. At the same time you might
440 want to send all other requests to some default server. After the realms for
441 the subdomains, you would then have two realm definitions. One with the name
442 \*(T</@.*\e\e.bv$\*(T> with no servers, followed by one with the name
443 \*(T<*\*(T> with the default server defined. This may also be useful
444 for blocking particular usernames.
445 .PP
446 If there is no \*(T<accountingServer\*(T> option, the proxy will
447 normally do nothing, ignoring accounting requests. There is however an option
448 called \*(T<accountingResponse\*(T>. If this is set to
449 \*(T<on\*(T>, the proxy will log some of the accounting information
450 and send an Accounting-Response back. This is useful if you do not care much
451 about accounting, but want to stop clients from retransmitting accounting
452 requests. By default this option is set to \*(T<off\*(T>.
453 .SH "TLS BLOCK"
454 The TLS block specifies TLS configuration options and you need at least one
455 of these if you have clients or servers using TLS/DTLS. As discussed in the
456 client and server block descriptions, a client or server block may reference
457 a particular TLS block by name. There are also however the special TLS block
458 names \*(T<default\*(T>, \*(T<defaultClient\*(T> and
459 \*(T<defaultServer\*(T> which are used as defaults if the client or
460 server block does not reference a TLS block. Also note that a TLS block must
461 be defined before the client or server block that would use it. If you want
462 the same TLS configuration for all TLS/DTLS clients and servers, you need
463 just a single tls block named \*(T<default\*(T>, and the client and
464 servers need not refer to it. If you want all TLS/DTLS clients to use one
465 config, and all TLS/DTLS servers to use another, then you would be fine only
466 defining two TLS blocks named \*(T<defaultClient\*(T> and
467 \*(T<defaultServer\*(T>. If you want different clients (or different
468 servers) to have different TLS parameters, then you may need to create other
469 TLS blocks with other names, and reference those from the client or server
470 definitions. Note that you could also have say a client block refer to a
471 default, even \*(T<defaultServer\*(T> if you really want to.
472 .PP
473 The available TLS block options are \*(T<CACertificateFile\*(T>,
474 \*(T<CACertificatePath\*(T>, \*(T<certificateFile\*(T>,
475 \*(T<certificateKeyFile\*(T>,
476 \*(T<certificateKeyPassword\*(T>, \*(T<cacheExpiry\*(T>,
477 \*(T<CRLCheck\*(T> and \*(T<policyOID\*(T>.
478 When doing RADIUS over TLS/DTLS, both the
479 client and the server present certificates, and they are both verified by
480 the peer. Hence you must always specify \*(T<certificateFile\*(T>
481 and \*(T<certificateKeyFile\*(T> options, as well as
482 \*(T<certificateKeyPassword\*(T> if a password is needed to decrypt
483 the private key. Note that \*(T<CACertificateFile\*(T> may be a
484 certificate chain. In order to verify certificates, or send a chain of
485 certificates to a peer, you also always need to specify
486 \*(T<CACertificateFile\*(T> or \*(T<CACertificatePath\*(T>.
487 Note that you may specify both, in which case the certificates in
488 \*(T<CACertificateFile\*(T> are checked first. By default CRLs are
489 not checked. This can be changed by setting \*(T<CRLCheck\*(T> to
490 \*(T<on\*(T>. One can require peer certificates to adhere to certain
491 policies by specifying one or multiple policyOIDs using one or multiple
492 \*(T<policyOID\*(T> options.
493 .PP
494 CA certificates and CRLs are normally cached permanently. That is, once a CA
495 or CRL has been read, the proxy will never attempt to re-read it. CRLs may
496 change relatively often and the proxy should ideally always use the latest
497 CRLs. Rather than restarting the proxy, there is an option
498 \*(T<cacheExpiry\*(T> that specifies how many seconds the CA and
499 CRL information should be cached. Reasonable values might be say 3600
500 (1 hour) or 86400 (24 hours), depending on how frequently CRLs are updated
501 and how critical it is to be up to date. This option may be set to zero to
502 disable caching.
503 .SH "REWRITE BLOCK"
504 The rewrite block specifies rules that may rewrite RADIUS messages. It can be
505 used to add, remove and modify specific attributes from messages received
506 from and sent to clients and servers. As discussed in the client and server
507 block descriptions, a client or server block may reference a particular
508 rewrite block by name. There are however also the special rewrite block names
509 \*(T<default\*(T>, \*(T<defaultClient\*(T> and
510 \*(T<defaultServer\*(T> which are used as defaults if the client or
511 server block does not reference a block. Also note that a rewrite block must
512 be defined before the client or server block that would use it. If you want
513 the same rewrite rules for input from all clients and servers, you need just
514 a single rewrite block named \*(T<default\*(T>, and the client and
515 servers need not refer to it. If you want all clients to use one config, and
516 all servers to use another, then you would be fine only defining two rewrite
517 blocks named \*(T<defaultClient\*(T> and
518 \*(T<defaultServer\*(T>. Note that these defaults are only used for
519 rewrite on input. No rewriting is done on output unless explicitly specifed
520 using the \*(T<rewriteOut\*(T> option.
521 .PP
522 The available rewrite block options are \*(T<addAttribute\*(T>,
523 \*(T<removeAttribute\*(T>, \*(T<removeVendorAttribute\*(T>
524 and \*(T<modifyAttribute\*(T>. They can all be specified none, one
525 or multiple times.
526 .PP
527 \*(T<addAttribute\*(T> is used to add attributes to a message. The
528 option value must be of the form \*(T<attribute:value\*(T> where
529 attribute is a numerical value specifying the attribute.
530 .PP
531 The \*(T<removeAttribute\*(T> option is used to specify an
532 attribute that should be removed from received messages. The option value
533 must be a numerical value specifying which attribute is to be removed.
534 Similarly, \*(T<removeVendorAttribute\*(T> is used to specify a
535 vendor attribute that is to be removed. The value can be a numerical value
536 for removing all attributes from a given vendor, or of the form
537 \*(T<vendor:subattribute\*(T>, where vendor and subattribute are
538 numerical values, for removing a specific subattribute for a specific
539 vendor.
540 .PP
541 \*(T<modifyAttribute\*(T> is used to specify modification of
542 attributes. The value must be of the form
543 \*(T<attribute:/regexpmatch/replacement/\*(T> where attribute is
544 a numerical attribute type, regexpmatch is regexp matching rule and
545 replacement specifies how to replace the matching regexp. Example usage:
546 .RS 
547 modifyAttribute 1:/^(.*)@local$/$1@example.com/
548 .RE
549 .SH "SEE ALSO"
550 \fBradsecproxy\fR(1),
551 .URL http://tools.ietf.org/html/draft-ietf-radext-radsec "         RadSec internet draft       "