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