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