made it so it works with mix of dynamic and static servers for a realm
[radsecproxy.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 2008-11-06 "radsecproxy devel 2008-11-06" ""
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 3 which logs
101 errors, warnings and some 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 if you specify port number.
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<listenAccountingUDP\*(T>
154 This is similar to the \*(T<listenUDP\*(T> option, except that it is
155 used for specifying port and optionally the address to receive UDP Accounting
156 messages on. 
157 .TP 
158 \*(T<sourceUDP\*(T>
159 This can be used to specify source address and/or source port that the proxy
160 will use for sending UDP client messages (e.g. Access Request).
161 .TP 
162 \*(T<sourceTCP\*(T>
163 This can be used to specify source address and/or source port that the proxy
164 will use for TCP connections.
165 .TP 
166 \*(T<sourceTLS\*(T>
167 This can be used to specify source address and/or source port that the proxy
168 will use for TLS connections.
169 .TP 
170 \*(T<sourceDTLS\*(T>
171 This can be used to specify source address and/or source port that the proxy
172 will use for DTLS connections.
173 .TP 
174 \*(T<TTLAttribute\*(T>
175 This can be used to change the default TTL attribute. Only change this if
176 you know what you are doing. The syntax is either a numerical value
177 denoting the TTL attribute, or two numerical values separated by column
178 specifying a vendor attribute, i.e. \*(T<vendorid:attribute\*(T>.
179 .TP 
180 \*(T<addTTL\*(T>
181 If a TTL attribute is present, the proxy will decrement the value and
182 discard the message if zero. Normally the proxy does nothing if no TTL
183 attribute is present. If you use the addTTL option with a value 1-255,
184 the proxy will when forwarding a message with no TTL attribute, add one
185 with the specified value. Note that this option can also be specified
186 for a client/server. It will then override this setting when forwarding
187 a message to that client/server.
188 .TP 
189 \*(T<loopPrevention\*(T>
190 This can be set to \*(T<on\*(T> or \*(T<off\*(T> with
191 \*(T<off\*(T> being the default. When this is enabled, a request
192 will never be sent to a server named the same as the client it was received
193 from. I.e., the names of the client block and the server block are compared.
194 Note that this only gives limited protection against loops.
195 .TP 
196 \*(T<include\*(T>
197 This is not a normal configuration option; it can be specified multiple times.
198 It can both be used as a basic option and inside blocks. For the full
199 description, see the configuration syntax section above.
200 .SH BLOCKS
201 There are five types of blocks, they are \*(T<client\*(T>,
202 \*(T<server\*(T>, \*(T<realm\*(T>, \*(T<tls\*(T>
203 and \*(T<rewrite\*(T>. At least one instance of each of
204 \*(T<client\*(T> and \*(T<realm\*(T> is required. This is
205 necessary for the proxy to do anything useful, and it will exit if not. The
206 \*(T<tls\*(T> block is required if at least one TLS/DTLS client or
207 server is configured. Note that there can be multiple blocks for each type.
208 For each type, the block names should be unique. The behaviour with multiple
209 occurences of the same name for the same block type is undefined. Also note
210 that some block option values may reference a block by name, in which case
211 the block name must be previously defined. Hence the order of the blocks may
212 be significant.
213 .SH "CLIENT BLOCK"
214 The client block is used to configure a client. That is, tell the proxy about a
215 client, and what parameters should be used for that client. The name of the
216 client block must (with one exception, see below) be either the IP address
217 (IPv4 or IPv6) of the client, an IP prefix (IPv4 or IPv6) of the form
218 IpAddress/PrefixLength, or a domain name (FQDN).
219 .PP
220 If a domain name is specified, then this will be resolved immediately to all
221 the addresses associated with the name, and the proxy will not care about any
222 possible DNS changes that might occur later. Hence there is no dependency on
223 DNS after startup.
224 .PP
225 When some client later sends a request to the proxy, the proxy will look at the
226 IP address the request comes from, and then go through all the addresses of
227 each of the configured clients (in the order they are defined), to determine
228 which (if any) of the clients this is.
229 .PP
230 In the case of TLS/DTLS, the name of the client must match the FQDN or IP
231 address in the client certificate. Note that this is not required when the
232 client name is an IP prefix.
233 .PP
234 Alternatively one may use the \*(T<host\*(T> option inside a client
235 block. In that case, the value of the \*(T<host\*(T> option is used as
236 above, while the name of the block is only used as a descriptive name for the
237 administrator.
238 .PP
239 The allowed options in a client block are \*(T<host\*(T>,
240 \*(T<type\*(T>, \*(T<secret\*(T>, \*(T<tls\*(T>,
241 \*(T<certificateNameCheck\*(T>,
242 \*(T<matchCertificateAttribute\*(T>,
243 \*(T<duplicateInterval\*(T>, \*(T<addTTL\*(T>,
244 \*(T<rewrite\*(T>, \*(T<rewriteIn\*(T>,
245 \*(T<rewriteOut\*(T> and \*(T<rewriteAttribute\*(T>.
246 We already discussed the
247 \*(T<host\*(T> option. The value of \*(T<type\*(T> must be
248 one of \*(T<udp\*(T>, \*(T<tcp\*(T>, \*(T<tls\*(T>
249 or \*(T<dtls\*(T>. The value of \*(T<secret\*(T> is the
250 shared RADIUS key used with this client. If the secret contains whitespace,
251 the value must be quoted. This option is optional for TLS/DTLS.
252 .PP
253 For a TLS/DTLS client you may also specify the \*(T<tls\*(T> option.
254 The option value must be the name of a previously defined TLS block. If this
255 option is not specified, the TLS block with the name
256 \*(T<defaultClient\*(T> will be used if defined. If not defined, it
257 will try to use the TLS block named \*(T<default\*(T>. If the
258 specified TLS block name does not exist, or the option is not specified and
259 none of the defaults exist, the proxy will exit with an error.
260 .PP
261 For a TLS/DTLS client, the option \*(T<certificateNameCheck\*(T>
262 can be set
263 to \*(T<off\*(T>, to disable the default behaviour of matching CN or
264 SubjectAltName against the specified hostname or IP address.
265 .PP
266 Additional validation of certificate attributes can be done by use of the
267 \*(T<matchCertificateAttribute\*(T> option. Currently one can only do
268 some matching of CN and SubjectAltName. For regexp matching on CN, one can use
269 the value \*(T<CN:/regexp/\*(T>. For SubjectAltName one can only do
270 regexp matching of the URI, this is specified as
271 \*(T<SubjectAltName:URI:/regexp/\*(T>. Note that currently this option
272 can only be specified once in a client block.
273 .PP
274 The \*(T<duplicateInterval\*(T> option can be used to specify for how
275 many seconds duplicate checking should be done. If a proxy receives a new
276 request within a few seconds of a previous one, it may be treated the same if
277 from the same client, with the same authenticator etc. The proxy will then
278 ignore the new request (if it is still processing the previous one), or
279 returned a copy of the previous reply.
280 .PP
281 The \*(T<addTTL\*(T> option is similar to the
282 \*(T<addTTL\*(T> option used in the basic config. See that for
283 details. Any value configured here overrides the basic one when sending
284 messages to this client.
285 .PP
286 The \*(T<rewrite\*(T> option is deprecated. Use
287 \*(T<rewriteIn\*(T> instead.
288 .PP
289 The \*(T<rewriteIn\*(T> option can be used to refer to a rewrite block
290 that specifies certain rewrite operations that should be performed on incoming
291 messages from the client. The rewriting is done before other processing.
292 For details, see the rewrite block text below. Similarly to
293 \*(T<tls\*(T> discussed above, if this option is not used, there is a
294 fallback to using the \*(T<rewrite\*(T> block named
295 \*(T<defaultClient\*(T> if it exists; and if not, a fallback to a
296 block named \*(T<default\*(T>.
297 .PP
298 The \*(T<rewriteOut\*(T> option is used in the same way as
299 \*(T<rewriteIn\*(T>, except that it specifies rewrite operations that
300 should be performed on outgoing messages to the client. The rewriting is done
301 after other processing. Also, there is no rewrite fallback if this option is
302 not used.
303 .PP
304 The \*(T<rewriteAttribute\*(T> option currently makes it possible to
305 specify that the User-Name attribute in a client request shall be rewritten in
306 the request sent by the proxy. The User-Name attribute is written back to the
307 original value if a matching response is later sent back to the client. The
308 value must be of the form User-Name:/regexpmatch/replacement/. Example usage:
309 .RS 
310 rewriteAttribute User-Name:/^(.*)@local$/$1@example.com/
311 .RE
312 .SH "SERVER BLOCK"
313 The server block is used to configure a server. That is, tell the proxy about a
314 server, and what parameters should be used when communicating with that server.
315 The name of the server block must (with one exception, see below) be either the
316 IP address (IPv4 or IPv6) of the server, or a domain name (FQDN). If a domain
317 name is specified, then this will be resolved immediately to all the addresses
318 associated with the name, and the proxy will not care about any possible DNS
319 changes that might occur later. Hence there is no dependency on DNS after
320 startup. If the domain name resolves to multiple addresses, then for UDP/DTLS
321 the first address is used. For TCP/TLS, the proxy will loop through the
322 addresses until it can connect to one of them. In the case of TLS/DTLS, the
323 name of the server must match the FQDN or IP address in the server certificate.
324 .PP
325 Alternatively one may use the \*(T<host\*(T> option inside a server
326 block. In that case, the value of the \*(T<host\*(T> option is used as
327 above, while the name of the block is only used as a descriptive name for the
328 administrator.
329 .PP
330 The allowed options in a server block are \*(T<host\*(T>,
331 \*(T<port\*(T>, \*(T<type\*(T>, \*(T<secret\*(T>,
332 \*(T<tls\*(T>, \*(T<certificateNameCheck\*(T>,
333 \*(T<matchCertificateAttribute\*(T>, \*(T<addTTL\*(T>,
334 \*(T<rewrite\*(T>,
335 \*(T<rewriteIn\*(T>, \*(T<rewriteOut\*(T>,
336 \*(T<statusServer\*(T>, \*(T<retryCount\*(T>,
337 \*(T<retryInterval\*(T> and \*(T<dynamicLookupCommand\*(T>.
338 .PP
339 We already discussed the \*(T<host\*(T> option. The
340 \*(T<port\*(T> option allows you to specify which port number the
341 server uses. The usage of \*(T<type\*(T>, \*(T<secret\*(T>,
342 \*(T<tls\*(T>, \*(T<certificateNameCheck\*(T>,
343 \*(T<matchCertificateAttribute\*(T>, \*(T<addTTL\*(T>,
344 \*(T<rewrite\*(T>,
345 \*(T<rewriteIn\*(T> and \*(T<rewriteOut\*(T> are just as
346 specified for the \*(T<client block\*(T> above, except that
347 \*(T<defaultServer\*(T> (and not \*(T<defaultClient\*(T>)
348 is the fallback for the \*(T<tls\*(T>, \*(T<rewrite\*(T>
349 and \*(T<rewriteIn\*(T> options.
350 .PP
351 \*(T<statusServer\*(T> can be specified to enable the use of
352 status-server messages for this server. The value must be either
353 \*(T<on\*(T> or \*(T<off\*(T>. The default when not
354 specified, is \*(T<off\*(T>. If statusserver is enabled, the proxy
355 will during idle periods send regular status-server messages to the server
356 to verify that it is alive. This should only be enabled if the server
357 supports it.
358 .PP
359 The options \*(T<retryCount\*(T> and
360 \*(T<retryInterval\*(T> can be used to specify how many times the
361 proxy should retry sending a request and how long it should wait between each
362 retry. The defaults are 2 retries and an interval of 5s.
363 .PP
364 The option \*(T<dynamicLookupCommand\*(T> can be used to specify a
365 command that should be executed to dynamically configure and use a server.
366 The use of this feature will be documented separately/later.
367 .SH "REALM BLOCK"
368 When the proxy receives an Access-Request it needs to figure out to which
369 server it should be forwarded. This is done by looking at the Username attribute
370 in the request, and matching that against the names of the defined realm blocks.
371 The proxy will match against the blocks in the order they are specified, using
372 the first match if any. If no realm matches, the proxy will simply ignore the
373 request. Each realm block specifies what the server should do when a match is
374 found. A realm block may contain none, one or multiple \*(T<server\*(T>
375 options, and similarly \*(T<accountingServer\*(T> options. There are
376 also \*(T<replyMessage\*(T> and \*(T<accountingResponse\*(T>
377 options. We will discuss these later.
378 .SS "REALM BLOCK NAMES AND MATCHING"
379 In the general case the proxy will look for a \*(T<@\*(T> in the
380 username attribute, and try to do an exact case insensitive match between what
381 comes after the \*(T<@\*(T> and the name of the realm block. So if you
382 get a request with the attribute value \*(T<anonymous@example.com\*(T>,
383 the proxy will go through the realm names in the order they are specified,
384 looking for a realm block named \*(T<example.com\*(T>.
385 .PP
386 There are two exceptions to this, one is the realm name \*(T<*\*(T>
387 which means match everything. Hence if you have a realm block named
388 \*(T<*\*(T>, then it will always match. This should then be the last
389 realm block defined, since any blocks after this would never be checked. This
390 is useful for having a default.
391 .PP
392 The other exception is regular expression matching. If the realm name starts
393 with a \*(T</\*(T>, the name is treated as an regular expression. A
394 case insensitive regexp match will then be done using this regexp on the value
395 of the entire Username attribute. Optionally you may also have a trailing
396 \*(T</\*(T> after the regexp. So as an example, if you want to use
397 regexp matching the domain \*(T<example.com\*(T> you could have a
398 realm block named \*(T</@example\e\e.com$\*(T>. Optinally this can also
399 be written \*(T</@example\e\e.com$/\*(T>. If you want to match all
400 domains under the \*(T<.com\*(T> top domain, you could do
401 \*(T</@.*\e\e.com$\*(T>. Note that since the matching is done on the
402 entire attribute value, you can also use rules like
403 \*(T</^[a\-k].*@example\e\e.com$/\*(T> to get some of the users in this
404 domain to use one server, while other users could be matched by another realm
405 block and use another server.
406 .SS "REALM BLOCK OPTIONS"
407 A realm block may contain none, one or multiple \*(T<server\*(T>
408 options. If defined, the values of the \*(T<server\*(T> options must
409 be the names of previously defined server blocks. Normally requests will be
410 forwarded to the first server option defined. If there are multiple server
411 options, the proxy will do fail-over and use the second server if the first
412 is down. If the two first are down, it will try the third etc. If say the
413 first server comes back up, it will go back to using that one. Currently
414 detection of servers being up or down is based on the use of StatusServer (if
415 enabled), and that TCP/TLS/DTLS connections are up.
416 .PP
417 A realm block may also contain none, one or multiple
418 \*(T<accountingServer\*(T> options. This is used exactly like the
419 \*(T<server\*(T> option, except that it is used for specifying where
420 to send matching accounting requests. The values must be the names of
421 previously defined server blocks. When multiple accounting servers are
422 defined, there is a failover mechanism similar to the one for the
423 \*(T<server\*(T> option.
424 .PP
425 If there is no \*(T<server\*(T> option, the proxy will if
426 \*(T<replyMessage\*(T> is specified, reply back to the client with
427 an Access Reject message. The message contains a replyMessage attribute with
428 the value as specified by the \*(T<replyMessage\*(T> option. Note
429 that this is different from having no match since then the request is simply
430 ignored. You may wonder why this is useful. One example is if you handle say
431 all domains under say \*(T<.bv\*(T>. Then you may have several realm
432 blocks matching the domains that exists, while for other domains under
433 \*(T<\&.bv\*(T> you want to send a reject. At the same time you might
434 want to send all other requests to some default server. After the realms for
435 the subdomains, you would then have two realm definitions. One with the name
436 \*(T</@.*\e\e.bv$\*(T> with no servers, followed by one with the name
437 \*(T<*\*(T> with the default server defined. This may also be useful
438 for blocking particular usernames.
439 .PP
440 If there is no \*(T<accountingServer\*(T> option, the proxy will
441 normally do nothing, ignoring accounting requests. There is however an option
442 called \*(T<accountingResponse\*(T>. If this is set to
443 \*(T<on\*(T>, the proxy will log some of the accounting information
444 and send an Accounting-Response back. This is useful if you do not care much
445 about accounting, but want to stop clients from retransmitting accounting
446 requests. By default this option is set to \*(T<off\*(T>.
447 .SH "TLS BLOCK"
448 The TLS block specifies TLS configuration options and you need at least one
449 of these if you have clients or servers using TLS/DTLS. As discussed in the
450 client and server block descriptions, a client or server block may reference
451 a particular TLS block by name. There are also however the special TLS block
452 names \*(T<default\*(T>, \*(T<defaultClient\*(T> and
453 \*(T<defaultServer\*(T> which are used as defaults if the client or
454 server block does not reference a TLS block. Also note that a TLS block must
455 be defined before the client or server block that would use it. If you want
456 the same TLS configuration for all TLS/DTLS clients and servers, you need
457 just a single tls block named \*(T<default\*(T>, and the client and
458 servers need not refer to it. If you want all TLS/DTLS clients to use one
459 config, and all TLS/DTLS servers to use another, then you would be fine only
460 defining two TLS blocks named \*(T<defaultClient\*(T> and
461 \*(T<defaultServer\*(T>. If you want different clients (or different
462 servers) to have different TLS parameters, then you may need to create other
463 TLS blocks with other names, and reference those from the client or server
464 definitions. Note that you could also have say a client block refer to a
465 default, even \*(T<defaultServer\*(T> if you really want to.
466 .PP
467 The available TLS block options are \*(T<CACertificateFile\*(T>,
468 \*(T<CACertificatePath\*(T>, \*(T<certificateFile\*(T>,
469 \*(T<certificateKeyFile\*(T>,
470 \*(T<certificateKeyPassword\*(T>, \*(T<cacheExpiry\*(T>,
471 \*(T<CRLCheck\*(T> and \*(T<policyOID\*(T>.
472 When doing RADIUS over TLS/DTLS, both the
473 client and the server present certificates, and they are both verified by
474 the peer. Hence you must always specify \*(T<certificateFile\*(T>
475 and \*(T<certificateKeyFile\*(T> options, as well as
476 \*(T<certificateKeyPassword\*(T> if a password is needed to decrypt
477 the private key. Note that \*(T<CACertificateFile\*(T> may be a
478 certificate chain. In order to verify certificates, or send a chain of
479 certificates to a peer, you also always need to specify
480 \*(T<CACertificateFile\*(T> or \*(T<CACertificatePath\*(T>.
481 Note that you may specify both, in which case the certificates in
482 \*(T<CACertificateFile\*(T> are checked first. By default CRLs are
483 not checked. This can be changed by setting \*(T<CRLCheck\*(T> to
484 \*(T<on\*(T>. One can require peer certificates to adhere to certain
485 policies by specifying one or multiple policyOIDs using one or multiple
486 \*(T<policyOID\*(T> options.
487 .PP
488 CA certificates and CRLs are normally cached permanently. That is, once a CA
489 or CRL has been read, the proxy will never attempt to re-read it. CRLs may
490 change relatively often and the proxy should ideally always use the latest
491 CRLs. Rather than restarting the proxy, there is an option
492 \*(T<cacheExpiry\*(T> that specifies how many seconds the CA and
493 CRL information should be cached. Reasonable values might be say 3600
494 (1 hour) or 86400 (24 hours), depending on how frequently CRLs are updated
495 and how critical it is to be up to date. This option may be set to zero to
496 disable caching.
497 .SH "REWRITE BLOCK"
498 The rewrite block specifies rules that may rewrite RADIUS messages. It can be
499 used to add, remove and modify specific attributes from messages received
500 from and sent to clients and servers. As discussed in the client and server
501 block descriptions, a client or server block may reference a particular
502 rewrite block by name. There are however also the special rewrite block names
503 \*(T<default\*(T>, \*(T<defaultClient\*(T> and
504 \*(T<defaultServer\*(T> which are used as defaults if the client or
505 server block does not reference a block. Also note that a rewrite block must
506 be defined before the client or server block that would use it. If you want
507 the same rewrite rules for input from all clients and servers, you need just
508 a single rewrite block named \*(T<default\*(T>, and the client and
509 servers need not refer to it. If you want all clients to use one config, and
510 all servers to use another, then you would be fine only defining two rewrite
511 blocks named \*(T<defaultClient\*(T> and
512 \*(T<defaultServer\*(T>. Note that these defaults are only used for
513 rewrite on input. No rewriting is done on output unless explicitly specifed
514 using the \*(T<rewriteOut\*(T> option.
515 .PP
516 The available rewrite block options are \*(T<addAttribute\*(T>,
517 \*(T<removeAttribute\*(T>, \*(T<removeVendorAttribute\*(T>
518 and \*(T<modifyAttribute\*(T>. They can all be specified none, one
519 or multiple times.
520 .PP
521 \*(T<addAttribute\*(T> is used to add attributes to a message. The
522 option value must be of the form \*(T<attribute:value\*(T> where
523 attribute is a numerical value specifying the attribute.
524 .PP
525 The \*(T<removeAttribute\*(T> option is used to specify an
526 attribute that should be removed from received messages. The option value
527 must be a numerical value specifying which attribute is to be removed.
528 Similarly, \*(T<removeVendorAttribute\*(T> is used to specify a
529 vendor attribute that is to be removed. The value can be a numerical value
530 for removing all attributes from a given vendor, or of the form
531 \*(T<vendor:subattribute\*(T>, where vendor and subattribute are
532 numerical values, for removing a specific subattribute for a specific
533 vendor.
534 .PP
535 \*(T<modifyAttribute\*(T> is used to specify modification of
536 attributes. The value must be of the form
537 \*(T<attribute:/regexpmatch/replacement/\*(T> where attribute is
538 a numerical attribute type, regexpmatch is regexp matching rule and
539 replacement specifies how to replace the matching regexp. Example usage:
540 .RS 
541 modifyAttribute 1:/^(.*)@local$/$1@example.com/
542 .RE
543 .SH "SEE ALSO"
544 \fBradsecproxy\fR(1),
545 .URL http://tools.ietf.org/html/draft-ietf-radext-radsec "         RadSec internet draft       "