summaryrefslogtreecommitdiff
path: root/radsecproxy.conf.5
blob: be37788f7612984fcfeee676514aeea5e4b91429 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
.TH radsecproxy.conf 5 "14 May 2008"

.SH "NAME"
radsecproxy.conf - Radsec proxy configuration file

.SH "DESCRIPTION"

When the proxy server starts, it will first check the command line arguments,
and then read the configuration file. Normally radsecproxy will read the
configuration file \fB/etc/radsecproxy.conf\fR. The command line -c option can
be used to instead read an alternate file (see \fIradsecproxy(1)\fR for details).
.sp
If the configuration file can not be found, the proxy will exit with an error
message. Note that there is also an include facility so that any configuration
file may include other configuration files. The proxy will also exit on
configuration errors.

.SH "CONFIGURATION SYNTAX"
When the configuration file is processed, whitespace (spaces and tabs) are
generally ignored. For each line, leading and trailing whitespace are ignored.
A line is ignored if it is empty, only consists of whitespace, or if the first 
non-whitespace character is a \fB#\fR. The configuration is generally case 
insensitive, but in some cases the option values (see below) are not.
.sp
There are two types of configuration structures than can be used. The first
and simplest are lines of the format \fIoption value\fR. That is, an option name,
see below for a list of valid options, followed by whitespace (at least one
space or tab character), followed by a value. Note that if the value contains
whitespace, then it must be quoted using "" or ''. Any whitespace in front of
the option or after the value will be ignored.
.sp
The other type of structure is a block. A block spans at least two lines, and
has the format:
.sp
.IP
.nf
blocktype name {
    option value
    option value
    ...
}
.fi
.LP
That is, some blocktype, see below for a list of the different block types, and
then enclosed in braces you have zero or more lines that each have the previously
described \fIoption value\fR format. Different block types have different rules for
which options can be specified, they are listed below. The rules regarding white
space, comments and quotes are as above. Hence you may do things like:
.sp
.IP
.nf
blocktype name {
#    option value
    option "value with space"
    ...
}
.fi
.LP
.sp
There is one special option that can be used both as a basic option and inside all
blocks. That is the option \fBInclude\fR where the value specifies files to be
included. The value can be a single file, or it can use normal shell globbing to
specify multiple files, e.g.:
.IP
.nf
include /etc/radsecproxy.conf.d/*.conf
.fi
.LP
The files are sorted alphabetically. Included files are read in the order they are
specified, when reaching the end of a file, the next file is read. When reaching
the end of the last included file, the proxy returns to read the next line
following the \fBInclude\fR option. Included files may again include other files.
.sp

.SH "BASIC OPTIONS"
The following basic options may be specified in the configuration file. Note that
blocktypes and options inside blocks are discussed later. Note that none of these
options are required, and indeed in many cases they are not needed. Note that you
should specify each at most once. The behaviour with multiple occurences is
undefined.
.sp
.TP
\fBLogLevel\fR
This option specifies the debug level. It must be set to 1, 2, 3 or 4, where 1
logs only serious errors, and 4 logs \fIeverything\fR. The default is 3 which logs
errors, warnings and some informational messages. Note that the command line option
\fB-d\fR overrides this if present.
.sp
.TP
\fBLogDestination\fR
This specifies where the log messages should go. By default the messages go to
syslog with facility \fBLOG_DAEMON\fR. Using this option you can specify another
syslog facility, or you may specify that logging should be to a particular file,
not using syslog. The value must be either a \fIfile\fR or \fIsyslog\fR URL. The
file URL is the standard one, specifying a local file that should be used. For
syslog, you must use the syntax: \fBx-syslog:///FACILITY\fR where
\fBFACILITY\fR must be one of \fBLOG_DAEMON\fR, \fBLOG_MAIL\fR, \fBLOG_USER\fR,
\fBLOG_LOCAL0\fR, \fBLOG_LOCAL1\fR, \fBLOG_LOCAL2\fR, \fBLOG_LOCAL3\fR,
\fBLOG_LOCAL4\fR, \fBLOG_LOCAL5\fR, \fBLOG_LOCAL6\fR or \fBLOG_LOCAL7\fR. You may
omit the facility from the URL to specify logging to the default facility, but
this is not very useful since this is the default log destination. Note that this
option is ignored if \fB-f\fR is specified on the command line.
.sp
.TP
\fBListenUDP\fR
Normally the proxy will listen to the standard RADIUS UDP port \fB1812\fR if
configured to handle UDP clients. On most systems it will do this for all of the
system's IP addresses (both IPv4 and IPv6). On some systems however, it may respond
to only IPv4 or only IPv6. To specify an alternate port you may use a value of
the form \fB*:port\fR where port is any valid port number. If you also want to
specify a specific address you can do e.g. \fB192.168.1.1:1812\fR or
\fB[2001:db8::1]:1812\fR. The port may be omitted if you want the default one
(like in these examples). These examples are equivalent to \fB192.168.1.1\fR and
\fB2001:db8::1\fR. Note that you must use brackets around the IPv6 address if
you specify port number.
.sp
.TP
\fBListenTCP\fR
This is similar to the \fBListenUDP\fR option, except that it used for receiving
connections from TCP clients. The default port number is \fB2083\fR.
.sp
.TP
\fBListenAccountingUDP\fR
This is similar to the \fBListenUDP\fR option, except that it used for specifying
port and optionally the address to receive UDP Accounting messages on.
.sp
.TP
\fBSourceUDP\fR
This can be used to specify source address and/or source port that the proxy
will use for sending UDP client messages (e.g. Access Request).
.sp
.TP
\fBSourceTCP\fR
This can be used to specify source address and/or source port that the proxy
will use for sending TCP client messages (e.g. Access Request).
.sp
.TP
\fBInclude\fR
This is not a normal configuration option; it can be specified multiple times.
It can both be used as a basic option and inside blocks. For the full description,
see the configuration syntax section above.
.sp

.SH "BLOCKS"
There are five types of blocks, they are \fBClient\fR, \fBServer\fR, \fBRealm\fR,
\fBTLS\fR and \fBRewrite\fR. At least one instance of each of \fBClient\fR,
\fBServer\fR and \fBRealm\fR is required.
This is necessary for the proxy to do anything useful,
and it will exit if not. The \fBTLS\fR block is required if at least one TLS
client or server is configured. Note that there can be multiple blocks for each
type. For each type, the block names should be unique. The behaviour with multiple
occurences of the same name for the same block type is undefined. Also note that
some block option values may reference a block by name, in which case the block
name must be previously defined. Hence the order of the blocks may be significant.
.sp

.SH "CLIENT BLOCK"
The client block is used to configure a client. That is, tell the proxy about a
client, and what parameters should be used for that client. The \fBname\fR of the
client block must (with one exception, see below) be either the IP address
(IPv4 or IPv6) of the client, an IP prefix (IPv4 or IPv6) of the form
IpAddress/PrefixLength, or a domain name (FQDN).
.sp
If a domain name is specified,
then this will be resolved immediately to all the addresses associated with the
name, and the proxy will not care about any possible DNS changes that might occur
later. Hence there is no dependency on DNS after startup.
.sp
When some client later
sends a request to the proxy, the proxy will look at the IP address the request
comes from, and then go through all the addresses of each of the configured
clients (in the order they are defined), to determine which (if any) of the
clients this is.
.sp
In the case of TLS, the name of the client must match the FQDN or IP address in
the client certificate. Note that this is not required when the client name is
an IP prefix.
.sp
Alternatively one may use the \fBhost\fR option inside a client block. In that
case, the value of the \fBhost\fR option is used as above, while the name of the
block is only used as a descriptive name for the administrator.
.sp
The allowed options in a client block are \fBhost\fR, \fBtype\fR, \fBsecret\fR,
\fBtls\fR, \fBcertificatenamecheck\fR, \fBmatchcertificateattribute\fR,
\fBrewrite\fR and \fBrewriteattribute\fR. We already
discussed the \fBhost\fR option.
The value of \fBtype\fR must be either \fBudp\fR or \fBtls\fR. The value of
\fBsecret\fR is the shared RADIUS key used with this client. If the secret
contains whitespace, the value must be quoted. This option is optional for TLS.
.sp
For a TLS client you may also specify the \fBtls\fR option. The option value must
be the name of a previously defined TLS block. If this option is not specified,
the TLS block with the name \fBdefaultclient\fR will be used if defined. If not
defined, it will try to use the TLS block named \fBdefault\fR. If the specified
TLS block name does not exist, or the option is not specified and none of the
defaults exist, the proxy will exit with an error.
.sp
For a TLS client, the option \fBcertificatenamecheck\fR can be set to \fBoff\fR,
to disable the default behaviour of matching CN or SubjectAltName against the
specified hostname or IP address.
.sp
Additional validation of certificate attributes can be done by use of the
\fBmatchcertificateattribute\fR option. Currently one can only do some
matching of CN and SubjectAltName. For regexp matching on CN, one can use
the value \fBCN:/regexp/\fR. For SubjectAltName one can only do regexp
matching of the URI, this is specified as \fBSubjectAltName:URI:/regexp/\fR.
Note that currently this option can only be specified once in a client block.
.sp
The \fBrewrite\fR option can be used to refer to a rewrite block that
specifies certain rewrite operations that should be performed on messages
from the client. For details, see the rewrite block text below. Similar to
\fBtls\fR discussed above, if this option is not used, there is a fallback to
using the \fBrewrite\fR block named \fBdefaultclient\fR if it exists; and
finally, if not, a fallback to a block named \fBdefault\fR.
.sp
The \fBrewriteattribute\fR option currently makes it possible to specify that
the User-Name attribute in a client request shall be rewritten in the request
sent by the proxy. The User-Name attribute is written back to the original
value if a matching response is later sent back to the client. The value must
be of the form User-Name:/regexpmatch/replacement/. Example usage:
.IP
.nf
rewriteattribute User-Name:/^(.*)@local$/$1@example.com/
.fi
.LP

.SH "SERVER BLOCK"
The server block is used to configure a server. That is, tell the proxy about
a server, and what parameters should be used when communicating with that server.
The \fBname\fR of the server block must (with one exception, see below) be either
the IP address (IPv4 or IPv6)
of the server, or a domain name (FQDN). If a domain name is specified, then this
will be resolved immediately to all the addresses associated with the name, and
the proxy will not care about any possible DNS changes that might occur later.
Hence there is no dependency on DNS after startup. If the domain name resolves
to multiple addresses, then for UDP the first address is used. For TLS, the proxy
will loop through the addresses until it can connect to one of them. In the case
of TLS, the name of the server must match the FQDN or IP address in the server
certificate.
.sp
Alternatively one may use the \fBhost\fR option inside a server block. In that
case, the value of the \fBhost\fR option is used as above, while the name of the
block is only used as a descriptive name for the administrator.
.sp
The allowed options in a server block are \fBhost\fR, \fBport\fR, \fBtype\fR,
\fBsecret\fR, \fBtls\fR, \fBcertificatenamecheck\fR,
\fBmatchcertificateattribute\fR, \fBrewrite\fR and \fBstatusserver\fR.
We already discussed the \fBhost\fR option.
The \fBport\fR option allows you to specify which port number the server uses.
The values of \fBtype\fR, \fBsecret\fR, \fBtls\fR, \fBcertificatenamecheck\fR,
\fBmatchcertificateattribute\fR and \fBrewrite\fR are just as specified for the
\fIclient block\fR above, except that \fBdefaultserve\fRr
(and not \fBdefaultclient\fR) are fallbacks if either of the \fBtls\fR or
\fBrewrite\fR options are not used.
.sp
\fBstatusserver\fR can be specified to enable the use of status-server messages
for this server. The value must be either \fBon\fR or \fBoff\fR. The default
when not specified, is \fBoff\fR. If statusserver is enabled, the proxy will
during idle periods send regular status-server messages to the server to verify
that it is alive. This should only be enabled if the server supports it.

.SH "REALM BLOCK"
When the proxy receives an \fBAccess Request\fR it needs to figure out to which
server it should be forwarded. This is done by looking at the Username attribute
in the request, and matching that against the names of the defined realm blocks.
The proxy will match against the blocks in the order they are specified, using
the first match if any. If no realm matches, the proxy will simply ignore the
request. Each realm block specifies what the server should do when a match is
found. A realm block may contain none, one or multiple \fBserver\fR options,
and optionally a \fBreplyMessage\fR option. We will discuss these later.
.sp

.TP
\fBRealm block names and matching\fR
.sp
In the general case the proxy will look for a @ in the username attribute, and
try to do an exact case insensitive match between what comes after the @ and
the name of the realm block. So if you get a request with the attribute value
\fBanonymous@example.com\fR, the proxy will go through the realm names in the
order they are specified, looking for a realm block named \fBexample.com\fR.
.sp
There are two exceptions to this, one is the realm name \fB*\fT which means
match everything. Hence if you have a realm block named \fB*\fR, then it will
always match. This should then be the last realm block defined, since any
blocks after this would never be checked. This is useful for having a default.
.sp
The other exception is regular expression matching. If the realm name starts
with a \fB/\fR, the name is treated as an regular expression. A case insensitive
regexp match will then be done using this regexp on the value of the entire
Username attribute. Optionally you may also have a trailing \fB/\fR after the
regexp. So as an example, if you want to use regexp matching the domain
\fBexample.com\fR you could have a realm block named \fB/@example\\.com$\fR.
Optinally this can also be written \fB/@example\\.com$/\fR. If you want to
match all domains under the \fB.com\fR top domain, you could do
\fB/@.*\\.com$\fR. Note that since the matching is done on the entire
attribute value, you can also use rules like \fB/^[a-k].*@example\\.com$/\fR
to get some of the users in this domain to use one server, while other users
could be matched by another realm block and use another server.
.sp 

.TP
\fBRealm block options\fR
.sp
A realm block may contain none, one or multiple \fBserver\fR options. If
defined, the values of the \fBserver\fR options must be the names of
previously defined server blocks. Normally requests will be forwarded to
the first server option defined. If there are multiple server options, the
proxy will do fail-over and use the second server if the first is down. If
the two first are down, it will try the third etc. If say the first server
comes back up, it will go back to using that one. Currently detection of
servers being up or down is based on the use of StatusServer (if enabled),
and that TLS connections are up.
.sp
A realm block may also contain none, one or multiple \fBaccountingserver\fR
options. This is used exactly like the \fBserver\fR options, except that
it is used for specifying where to send matching accounting requests. The
values must be the names of previously defined server blocks. When multiple
accounting servers are defined, there is a failover mechanism similar to
the one for \fBserver\fR options.
.sp
If there is no \fBserver\fR option, the proxy will reply back to the client
with an Access Reject message. Note that this is different from having no
match since then the request is simply ignored. You may wonder why this is
useful. One example is if you handle say all domains under say \fB.bv\fR.
Then you may have several realm blocks matching the domains that exists,
while for other domains under \fB.bv\fR you want to send a reject. At the
same time you might want to send all other requests to some default server.
After the realms for the subdomains, you would then have two realm
definitions. One with the name \fB/@.*\\.bv$\fR with no servers, followed
by one with the name \fB*\fR with the default server defined. This may also
be useful for blocking particular usernames.
.sp
When sending reject messages, the proxy will check if the option
\fBreplyMessage\fR is set for the realm. If it is, it will add a replyMessage
attribute to the reject message with this value. Note that you need to quote
the message if it contains white space.
.sp

.SH "TLS BLOCK"
The TLS block specifies TLS configuration options and you need at least one
of these if you have clients or servers using TLS. As discussed in the client
and server block descriptions, a client or server block may reference a
particular TLS block by name. There are also however the special TLS block
names \fBdefault\fR, \fBdefaultclient\fR and \fBdefaultserver\fR which are
used as defaults if the client or server block does not reference a TLS block.
Also note that a TLS block must be defined before the client or server block
that would use it. If you want the same TLS configuration for all TLS clients
and servers, you need just a single TLS block named \fBdefault\fR, and the client
and servers need not refer to it. If you want all TLS clients to use one
config, and all TLS servers to use another, then you would be fine only
defining two TLS blocks named \fBdefaultclient\fR and \fBdefaultserver\fR.
If you want different clients (or different servers) to have different TLS
parameters, then you may need to create other TLS blocks with other names,
and reference those from the client or server definitions. Note that you could
also have say a client block refer to a default, even \fBdefaultserver\fR
if you really want to.
.sp
The available TLS block options are \fBCACertificateFile\fR,
\fBCACertificatePath\fR, \fBCertificateFile\fR, \fBCertificateKeyFile\fR
and \fBCertificateKeyPassword\fR. When doing RADIUS over TLS, both the
client and the server present certificates, and they are both verified
by the peer. Hence you must always specify \fBCertificateFile\fR and
\fBCertificateKeyFile\fR options, as well as \fBCertificateKeyPassword\fR
if a password is needed to decrypt the private key. Note that
\fBCACertificateFile\fR may be a certificate chain. In order to verify
certificates, or send a chain of certificates to a peer, you also always
need to specify \fBCACertificateFile\fR or \fBCACertificatePath\fR. Note
that you may specify both, in which case the certificates in
\fBCACertificateFile\fR are checked first.

.SH "REWRITE BLOCK"
The rewrite block specifies rules that may rewrite RADIUS messages. It
can currently be used to remove specific attributes from messages
received from clients or servers. As discussed in the client and server
block descriptions, a client or server block may reference a particular
rewrite block by name. There are also however the special rewrite block
names \fBdefault\fR, \fBdefaultclient\fR and \fBdefaultserver\fR which are
used as defaults if the client or server block does not reference a block.
Also note that a rewrite block must be defined before the client or server
block that would use it. If you want the same rewrite rules for all clients
and servers, you need just a single rewrite block named \fBdefault\fR, and
the client and servers need not refer to it. If you want all clients to use
one config, and all servers to use another, then you would be fine only
defining two rewrite blocks named \fBdefaultclient\fR and \fBdefaultserver\fR.
.sp
The available rewrite block options are \fBremoveattribute\fR and
\fBremovevendorattribute\fR, they can both be specified none, one or multiple
times. The \fBremoveattribute\fR option is used to specify an attribute that
should be removed from received messages. The option value must be a numerical
value specifying which attribute is to be removed. Similarly,
\fBremovevendorattribute\fR is used to specify a vendor attribute that is to
be removed. The value can be a numerical value for removing all attributes
from a given vendor, or of the form vendor:subattribute, where vendor and
subattribute are numerical values, for removing a specific subattribute for a
specific vendor.

.SH "SEE ALSO"
radsecproxy(1), RadSec draft paper.