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