updated man pages dates
[libradsec.git] / radsecproxy.conf.5
1 .TH radsecproxy.conf 5 "14 May 2008"
2
3 .SH "NAME"
4 radsecproxy.conf - Radsec proxy configuration file
5
6 .SH "DESCRIPTION"
7
8 When the proxy server starts, it will first check the command line arguments,
9 and then read the configuration file. Normally radsecproxy will read the
10 configuration file \fB/etc/radsecproxy.conf\fR. The command line -c option can
11 be used to instead read an alternate file (see \fIradsecproxy(1)\fR for details).
12 .sp
13 If the configuration file can not be found, the proxy will exit with an error
14 message. Note that there is also an include facility so that any configuration
15 file may include other configuration files. The proxy will also exit on
16 configuration errors.
17
18 .SH "CONFIGURATION SYNTAX"
19 When the configuration file is processed, whitespace (spaces and tabs) are
20 generally ignored. For each line, leading and trailing whitespace are ignored.
21 A line is ignored if it is empty, only consists of whitespace, or if the first 
22 non-whitespace character is a \fB#\fR. The configuration is generally case 
23 insensitive, but in some cases the option values (see below) are not.
24 .sp
25 There are two types of configuration structures than can be used. The first
26 and simplest are lines of the format \fIoption value\fR. That is, an option name,
27 see below for a list of valid options, followed by whitespace (at least one
28 space or tab character), followed by a value. Note that if the value contains
29 whitespace, then it must be quoted using "" or ''. Any whitespace in front of
30 the option or after the value will be ignored.
31 .sp
32 The other type of structure is a block. A block spans at least two lines, and
33 has the format:
34 .sp
35 .IP
36 .nf
37 blocktype name {
38     option value
39     option value
40     ...
41 }
42 .fi
43 .LP
44 That is, some blocktype, see below for a list of the different block types, and
45 then enclosed in braces you have zero or more lines that each have the previously
46 described \fIoption value\fR format. Different block types have different rules for
47 which options can be specified, they are listed below. The rules regarding white
48 space, comments and quotes are as above. Hence you may do things like:
49 .sp
50 .IP
51 .nf
52 blocktype name {
53 #    option value
54     option "value with space"
55     ...
56 }
57 .fi
58 .LP
59 .sp
60 There is one special option that can be used both as a basic option and inside all
61 blocks. That is the option \fBInclude\fR where the value specifies files to be
62 included. The value can be a single file, or it can use normal shell globbing to
63 specify multiple files, e.g.:
64 .IP
65 .nf
66 include /etc/radsecproxy.conf.d/*.conf
67 .fi
68 .LP
69 The files are sorted alphabetically. Included files are read in the order they are
70 specified, when reaching the end of a file, the next file is read. When reaching
71 the end of the last included file, the proxy returns to read the next line
72 following the \fBInclude\fR option. Included files may again include other files.
73 .sp
74
75 .SH "BASIC OPTIONS"
76 The following basic options may be specified in the configuration file. Note that
77 blocktypes and options inside blocks are discussed later. Note that none of these
78 options are required, and indeed in many cases they are not needed. Note that you
79 should specify each at most once. The behaviour with multiple occurences is
80 undefined.
81 .sp
82 .TP
83 \fBLogLevel\fR
84 This option specifies the debug level. It must be set to 1, 2, 3 or 4, where 1
85 logs only serious errors, and 4 logs \fIeverything\fR. The default is 3 which logs
86 errors, warnings and some informational messages. Note that the command line option
87 \fB-d\fR overrides this if present.
88 .sp
89 .TP
90 \fBLogDestination\fR
91 This specifies where the log messages should go. By default the messages go to
92 syslog with facility \fBLOG_DAEMON\fR. Using this option you can specify another
93 syslog facility, or you may specify that logging should be to a particular file,
94 not using syslog. The value must be either a \fIfile\fR or \fIsyslog\fR URL. The
95 file URL is the standard one, specifying a local file that should be used. For
96 syslog, you must use the syntax: \fBx-syslog:///FACILITY\fR where
97 \fBFACILITY\fR must be one of \fBLOG_DAEMON\fR, \fBLOG_MAIL\fR, \fBLOG_USER\fR,
98 \fBLOG_LOCAL0\fR, \fBLOG_LOCAL1\fR, \fBLOG_LOCAL2\fR, \fBLOG_LOCAL3\fR,
99 \fBLOG_LOCAL4\fR, \fBLOG_LOCAL5\fR, \fBLOG_LOCAL6\fR or \fBLOG_LOCAL7\fR. You may
100 omit the facility from the URL to specify logging to the default facility, but
101 this is not very useful since this is the default log destination. Note that this
102 option is ignored if \fB-f\fR is specified on the command line.
103 .sp
104 .TP
105 \fBListenUDP\fR
106 Normally the proxy will listen to the standard RADIUS UDP port \fB1812\fR if
107 configured to handle UDP clients. On most systems it will do this for all of the
108 system's IP addresses (both IPv4 and IPv6). On some systems however, it may respond
109 to only IPv4 or only IPv6. To specify an alternate port you may use a value of
110 the form \fB*:port\fR where port is any valid port number. If you also want to
111 specify a specific address you can do e.g. \fB192.168.1.1:1812\fR or
112 \fB[2001:db8::1]:1812\fR. The port may be omitted if you want the default one
113 (like in these examples). These examples are equivalent to \fB192.168.1.1\fR and
114 \fB2001:db8::1\fR. Note that you must use brackets around the IPv6 address if
115 you specify port number.
116 .sp
117 .TP
118 \fBListenTCP\fR
119 This is similar to the \fBListenUDP\fR option, except that it used for receiving
120 connections from TCP clients. The default port number is \fB2083\fR.
121 .sp
122 .TP
123 \fBListenAccountingUDP\fR
124 This is similar to the \fBListenUDP\fR option, except that it used for specifying
125 port and optionally the address to receive UDP Accounting messages on.
126 .sp
127 .TP
128 \fBSourceUDP\fR
129 This can be used to specify source address and/or source port that the proxy
130 will use for sending UDP client messages (e.g. Access Request).
131 .sp
132 .TP
133 \fBSourceTCP\fR
134 This can be used to specify source address and/or source port that the proxy
135 will use for sending TCP client messages (e.g. Access Request).
136 .sp
137 .TP
138 \fBInclude\fR
139 This is not a normal configuration option; it can be specified multiple times.
140 It can both be used as a basic option and inside blocks. For the full description,
141 see the configuration syntax section above.
142 .sp
143
144 .SH "BLOCKS"
145 There are five types of blocks, they are \fBClient\fR, \fBServer\fR, \fBRealm\fR,
146 \fBTLS\fR and \fBRewrite\fR. At least one instance of each of \fBClient\fR,
147 \fBServer\fR and \fBRealm\fR is required.
148 This is necessary for the proxy to do anything useful,
149 and it will exit if not. The \fBTLS\fR block is required if at least one TLS
150 client or server is configured. Note that there can be multiple blocks for each
151 type. For each type, the block names should be unique. The behaviour with multiple
152 occurences of the same name for the same block type is undefined. Also note that
153 some block option values may reference a block by name, in which case the block
154 name must be previously defined. Hence the order of the blocks may be significant.
155 .sp
156
157 .SH "CLIENT BLOCK"
158 The client block is used to configure a client. That is, tell the proxy about a
159 client, and what parameters should be used for that client. The \fBname\fR of the
160 client block must (with one exception, see below) be either the IP address
161 (IPv4 or IPv6) of the client, an IP prefix (IPv4 or IPv6) of the form
162 IpAddress/PrefixLength, or a domain name (FQDN).
163 .sp
164 If a domain name is specified,
165 then this will be resolved immediately to all the addresses associated with the
166 name, and the proxy will not care about any possible DNS changes that might occur
167 later. Hence there is no dependency on DNS after startup.
168 .sp
169 When some client later
170 sends a request to the proxy, the proxy will look at the IP address the request
171 comes from, and then go through all the addresses of each of the configured
172 clients (in the order they are defined), to determine which (if any) of the
173 clients this is.
174 .sp
175 In the case of TLS, the name of the client must match the FQDN or IP address in
176 the client certificate. Note that this is not required when the client name is
177 an IP prefix.
178 .sp
179 Alternatively one may use the \fBhost\fR option inside a client block. In that
180 case, the value of the \fBhost\fR option is used as above, while the name of the
181 block is only used as a descriptive name for the administrator.
182 .sp
183 The allowed options in a client block are \fBhost\fR, \fBtype\fR, \fBsecret\fR,
184 \fBtls\fR, \fBcertificatenamecheck\fR, \fBmatchcertificateattribute\fR,
185 \fBrewrite\fR and \fBrewriteattribute\fR. We already
186 discussed the \fBhost\fR option.
187 The value of \fBtype\fR must be either \fBudp\fR or \fBtls\fR. The value of
188 \fBsecret\fR is the shared RADIUS key used with this client. If the secret
189 contains whitespace, the value must be quoted. This option is optional for TLS.
190 .sp
191 For a TLS client you may also specify the \fBtls\fR option. The option value must
192 be the name of a previously defined TLS block. If this option is not specified,
193 the TLS block with the name \fBdefaultclient\fR will be used if defined. If not
194 defined, it will try to use the TLS block named \fBdefault\fR. If the specified
195 TLS block name does not exist, or the option is not specified and none of the
196 defaults exist, the proxy will exit with an error.
197 .sp
198 For a TLS client, the option \fBcertificatenamecheck\fR can be set to \fBoff\fR,
199 to disable the default behaviour of matching CN or SubjectAltName against the
200 specified hostname or IP address.
201 .sp
202 Additional validation of certificate attributes can be done by use of the
203 \fBmatchcertificateattribute\fR option. Currently one can only do some
204 matching of CN and SubjectAltName. For regexp matching on CN, one can use
205 the value \fBCN:/regexp/\fR. For SubjectAltName one can only do regexp
206 matching of the URI, this is specified as \fBSubjectAltName:URI:/regexp/\fR.
207 Note that currently this option can only be specified once in a client block.
208 .sp
209 The \fBrewrite\fR option can be used to refer to a rewrite block that
210 specifies certain rewrite operations that should be performed on messages
211 from the client. For details, see the rewrite block text below. Similar to
212 \fBtls\fR discussed above, if this option is not used, there is a fallback to
213 using the \fBrewrite\fR block named \fBdefaultclient\fR if it exists; and
214 finally, if not, a fallback to a block named \fBdefault\fR.
215 .sp
216 The \fBrewriteattribute\fR option currently makes it possible to specify that
217 the User-Name attribute in a client request shall be rewritten in the request
218 sent by the proxy. The User-Name attribute is written back to the original
219 value if a matching response is later sent back to the client. The value must
220 be of the form User-Name:/regexpmatch/replacement/. Example usage:
221 .IP
222 .nf
223 rewriteattribute User-Name:/^(.*)@local$/$1@example.com/
224 .fi
225 .LP
226
227 .SH "SERVER BLOCK"
228 The server block is used to configure a server. That is, tell the proxy about
229 a server, and what parameters should be used when communicating with that server.
230 The \fBname\fR of the server block must (with one exception, see below) be either
231 the IP address (IPv4 or IPv6)
232 of the server, or a domain name (FQDN). If a domain name is specified, then this
233 will be resolved immediately to all the addresses associated with the name, and
234 the proxy will not care about any possible DNS changes that might occur later.
235 Hence there is no dependency on DNS after startup. If the domain name resolves
236 to multiple addresses, then for UDP the first address is used. For TLS, the proxy
237 will loop through the addresses until it can connect to one of them. In the case
238 of TLS, the name of the server must match the FQDN or IP address in the server
239 certificate.
240 .sp
241 Alternatively one may use the \fBhost\fR option inside a server block. In that
242 case, the value of the \fBhost\fR option is used as above, while the name of the
243 block is only used as a descriptive name for the administrator.
244 .sp
245 The allowed options in a server block are \fBhost\fR, \fBport\fR, \fBtype\fR,
246 \fBsecret\fR, \fBtls\fR, \fBcertificatenamecheck\fR,
247 \fBmatchcertificateattribute\fR, \fBrewrite\fR and \fBstatusserver\fR.
248 We already discussed the \fBhost\fR option.
249 The \fBport\fR option allows you to specify which port number the server uses.
250 The values of \fBtype\fR, \fBsecret\fR, \fBtls\fR, \fBcertificatenamecheck\fR,
251 \fBmatchcertificateattribute\fR and \fBrewrite\fR are just as specified for the
252 \fIclient block\fR above, except that \fBdefaultserve\fRr
253 (and not \fBdefaultclient\fR) are fallbacks if either of the \fBtls\fR or
254 \fBrewrite\fR options are not used.
255 .sp
256 \fBstatusserver\fR can be specified to enable the use of status-server messages
257 for this server. The value must be either \fBon\fR or \fBoff\fR. The default
258 when not specified, is \fBoff\fR. If statusserver is enabled, the proxy will
259 during idle periods send regular status-server messages to the server to verify
260 that it is alive. This should only be enabled if the server supports it.
261
262 .SH "REALM BLOCK"
263 When the proxy receives an \fBAccess Request\fR it needs to figure out to which
264 server it should be forwarded. This is done by looking at the Username attribute
265 in the request, and matching that against the names of the defined realm blocks.
266 The proxy will match against the blocks in the order they are specified, using
267 the first match if any. If no realm matches, the proxy will simply ignore the
268 request. Each realm block specifies what the server should do when a match is
269 found. A realm block may contain none, one or multiple \fBserver\fR options,
270 and optionally a \fBreplyMessage\fR option. We will discuss these later.
271 .sp
272
273 .TP
274 \fBRealm block names and matching\fR
275 .sp
276 In the general case the proxy will look for a @ in the username attribute, and
277 try to do an exact case insensitive match between what comes after the @ and
278 the name of the realm block. So if you get a request with the attribute value
279 \fBanonymous@example.com\fR, the proxy will go through the realm names in the
280 order they are specified, looking for a realm block named \fBexample.com\fR.
281 .sp
282 There are two exceptions to this, one is the realm name \fB*\fT which means
283 match everything. Hence if you have a realm block named \fB*\fR, then it will
284 always match. This should then be the last realm block defined, since any
285 blocks after this would never be checked. This is useful for having a default.
286 .sp
287 The other exception is regular expression matching. If the realm name starts
288 with a \fB/\fR, the name is treated as an regular expression. A case insensitive
289 regexp match will then be done using this regexp on the value of the entire
290 Username attribute. Optionally you may also have a trailing \fB/\fR after the
291 regexp. So as an example, if you want to use regexp matching the domain
292 \fBexample.com\fR you could have a realm block named \fB/@example\\.com$\fR.
293 Optinally this can also be written \fB/@example\\.com$/\fR. If you want to
294 match all domains under the \fB.com\fR top domain, you could do
295 \fB/@.*\\.com$\fR. Note that since the matching is done on the entire
296 attribute value, you can also use rules like \fB/^[a-k].*@example\\.com$/\fR
297 to get some of the users in this domain to use one server, while other users
298 could be matched by another realm block and use another server.
299 .sp 
300
301 .TP
302 \fBRealm block options\fR
303 .sp
304 A realm block may contain none, one or multiple \fBserver\fR options. If
305 defined, the values of the \fBserver\fR options must be the names of
306 previously defined server blocks. Normally requests will be forwarded to
307 the first server option defined. If there are multiple server options, the
308 proxy will do fail-over and use the second server if the first is down. If
309 the two first are down, it will try the third etc. If say the first server
310 comes back up, it will go back to using that one. Currently detection of
311 servers being up or down is based on the use of StatusServer (if enabled),
312 and that TLS connections are up.
313 .sp
314 A realm block may also contain none, one or multiple \fBaccountingserver\fR
315 options. This is used exactly like the \fBserver\fR options, except that
316 it is used for specifying where to send matching accounting requests. The
317 values must be the names of previously defined server blocks. When multiple
318 accounting servers are defined, there is a failover mechanism similar to
319 the one for \fBserver\fR options.
320 .sp
321 If there is no \fBserver\fR option, the proxy will reply back to the client
322 with an Access Reject message. Note that this is different from having no
323 match since then the request is simply ignored. You may wonder why this is
324 useful. One example is if you handle say all domains under say \fB.bv\fR.
325 Then you may have several realm blocks matching the domains that exists,
326 while for other domains under \fB.bv\fR you want to send a reject. At the
327 same time you might want to send all other requests to some default server.
328 After the realms for the subdomains, you would then have two realm
329 definitions. One with the name \fB/@.*\\.bv$\fR with no servers, followed
330 by one with the name \fB*\fR with the default server defined. This may also
331 be useful for blocking particular usernames.
332 .sp
333 When sending reject messages, the proxy will check if the option
334 \fBreplyMessage\fR is set for the realm. If it is, it will add a replyMessage
335 attribute to the reject message with this value. Note that you need to quote
336 the message if it contains white space.
337 .sp
338
339 .SH "TLS BLOCK"
340 The TLS block specifies TLS configuration options and you need at least one
341 of these if you have clients or servers using TLS. As discussed in the client
342 and server block descriptions, a client or server block may reference a
343 particular TLS block by name. There are also however the special TLS block
344 names \fBdefault\fR, \fBdefaultclient\fR and \fBdefaultserver\fR which are
345 used as defaults if the client or server block does not reference a TLS block.
346 Also note that a TLS block must be defined before the client or server block
347 that would use it. If you want the same TLS configuration for all TLS clients
348 and servers, you need just a single TLS block named \fBdefault\fR, and the client
349 and servers need not refer to it. If you want all TLS clients to use one
350 config, and all TLS servers to use another, then you would be fine only
351 defining two TLS blocks named \fBdefaultclient\fR and \fBdefaultserver\fR.
352 If you want different clients (or different servers) to have different TLS
353 parameters, then you may need to create other TLS blocks with other names,
354 and reference those from the client or server definitions. Note that you could
355 also have say a client block refer to a default, even \fBdefaultserver\fR
356 if you really want to.
357 .sp
358 The available TLS block options are \fBCACertificateFile\fR,
359 \fBCACertificatePath\fR, \fBCertificateFile\fR, \fBCertificateKeyFile\fR
360 and \fBCertificateKeyPassword\fR. When doing RADIUS over TLS, both the
361 client and the server present certificates, and they are both verified
362 by the peer. Hence you must always specify \fBCertificateFile\fR and
363 \fBCertificateKeyFile\fR options, as well as \fBCertificateKeyPassword\fR
364 if a password is needed to decrypt the private key. Note that
365 \fBCACertificateFile\fR may be a certificate chain. In order to verify
366 certificates, or send a chain of certificates to a peer, you also always
367 need to specify \fBCACertificateFile\fR or \fBCACertificatePath\fR. Note
368 that you may specify both, in which case the certificates in
369 \fBCACertificateFile\fR are checked first.
370
371 .SH "REWRITE BLOCK"
372 The rewrite block specifies rules that may rewrite RADIUS messages. It
373 can currently be used to remove specific attributes from messages
374 received from clients or servers. As discussed in the client and server
375 block descriptions, a client or server block may reference a particular
376 rewrite block by name. There are also however the special rewrite block
377 names \fBdefault\fR, \fBdefaultclient\fR and \fBdefaultserver\fR which are
378 used as defaults if the client or server block does not reference a block.
379 Also note that a rewrite block must be defined before the client or server
380 block that would use it. If you want the same rewrite rules for all clients
381 and servers, you need just a single rewrite block named \fBdefault\fR, and
382 the client and servers need not refer to it. If you want all clients to use
383 one config, and all servers to use another, then you would be fine only
384 defining two rewrite blocks named \fBdefaultclient\fR and \fBdefaultserver\fR.
385 .sp
386 The available rewrite block options are \fBremoveattribute\fR and
387 \fBremovevendorattribute\fR, they can both be specified none, one or multiple
388 times. The \fBremoveattribute\fR option is used to specify an attribute that
389 should be removed from received messages. The option value must be a numerical
390 value specifying which attribute is to be removed. Similarly,
391 \fBremovevendorattribute\fR is used to specify a vendor attribute that is to
392 be removed. The value can be a numerical value for removing all attributes
393 from a given vendor, or of the form vendor:subattribute, where vendor and
394 subattribute are numerical values, for removing a specific subattribute for a
395 specific vendor.
396
397 .SH "SEE ALSO"
398 radsecproxy(1), RadSec draft paper.