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