4e46a2b9a87d04366f31efca5cb7cf686ef9252f
[freeradius.git] / raddb / sites-available / default
1 ######################################################################
2 #
3 #       As of 2.0.0, FreeRADIUS supports virtual hosts using the
4 #       "server" section, and configuration directives.
5 #
6 #       Virtual hosts should be put into the "sites-available"
7 #       directory.  Soft links should be created in the "sites-enabled"
8 #       directory to these files.  This is done in a normal installation.
9 #
10 #       $Id$
11 #
12 ######################################################################
13 #
14 #       Read "man radiusd" before editing this file.  See the section
15 #       titled DEBUGGING.  It outlines a method where you can quickly
16 #       obtain the configuration you want, without running into
17 #       trouble.  See also "man unlang", which documents the format
18 #       of this file.
19 #
20 #       This configuration is designed to work in the widest possible
21 #       set of circumstances, with the widest possible number of
22 #       authentication methods.  This means that in general, you should
23 #       need to make very few changes to this file.
24 #
25 #       The best way to configure the server for your local system
26 #       is to CAREFULLY edit this file.  Most attempts to make large
27 #       edits to this file will BREAK THE SERVER.  Any edits should
28 #       be small, and tested by running the server with "radiusd -X".
29 #       Once the edits have been verified to work, save a copy of these
30 #       configuration files somewhere.  (e.g. as a "tar" file).  Then,
31 #       make more edits, and test, as above.
32 #
33 #       There are many "commented out" references to modules such
34 #       as ldap, sql, etc.  These references serve as place-holders.
35 #       If you need the functionality of that module, then configure
36 #       it in radiusd.conf, and un-comment the references to it in
37 #       this file.  In most cases, those small changes will result
38 #       in the server being able to connect to the DB, and to
39 #       authenticate users.
40 #
41 ######################################################################
42
43 #
44 #       In 1.x, the "authorize", etc. sections were global in
45 #       radiusd.conf.  As of 2.0, they SHOULD be in a server section.
46 #
47 #       The server section with no virtual server name is the "default"
48 #       section.  It is used when no server name is specified.
49 #
50 #       We don't indent the rest of this file, because doing so
51 #       would make it harder to read.
52 #
53
54 #  Authorization. First preprocess (hints and huntgroups files),
55 #  then realms, and finally look in the "users" file.
56 #
57 #  The order of the realm modules will determine the order that
58 #  we try to find a matching realm.
59 #
60 #  Make *sure* that 'preprocess' comes before any realm if you 
61 #  need to setup hints for the remote radius server
62 authorize {
63         #
64         #  The preprocess module takes care of sanitizing some bizarre
65         #  attributes in the request, and turning them into attributes
66         #  which are more standard.
67         #
68         #  It takes care of processing the 'raddb/hints' and the
69         #  'raddb/huntgroups' files.
70         #
71         #  It also adds the %{Client-IP-Address} attribute to the request.
72         preprocess
73
74         #
75         #  If you want to have a log of authentication requests,
76         #  un-comment the following line, and the 'detail auth_log'
77         #  section, above.
78 #       auth_log
79
80         #
81         #  The chap module will set 'Auth-Type := CHAP' if we are
82         #  handling a CHAP request and Auth-Type has not already been set
83         chap
84
85         #
86         #  If the users are logging in with an MS-CHAP-Challenge
87         #  attribute for authentication, the mschap module will find
88         #  the MS-CHAP-Challenge attribute, and add 'Auth-Type := MS-CHAP'
89         #  to the request, which will cause the server to then use
90         #  the mschap module for authentication.
91         mschap
92
93         #
94         #  If you have a Cisco SIP server authenticating against
95         #  FreeRADIUS, uncomment the following line, and the 'digest'
96         #  line in the 'authenticate' section.
97 #       digest
98
99         #
100         #  The WiMAX specification says that the Calling-Station-Id
101         #  is 6 octets of the MAC.  This definition conflicts with
102         #  RFC 3580, and all common RADIUS practices.  Un-commenting
103         #  the "wimax" module here means that it will fix the
104         #  Calling-Station-Id attribute to the normal format as
105         #  specified in RFC 3580 Section 3.21
106 #       wimax
107
108         #
109         #  Look for IPASS style 'realm/', and if not found, look for
110         #  '@realm', and decide whether or not to proxy, based on
111         #  that.
112 #       IPASS
113
114         #
115         #  If you are using multiple kinds of realms, you probably
116         #  want to set "ignore_null = yes" for all of them.
117         #  Otherwise, when the first style of realm doesn't match,
118         #  the other styles won't be checked.
119         #
120         suffix
121 #       ntdomain
122
123         #
124         #  This module takes care of EAP-MD5, EAP-TLS, and EAP-LEAP
125         #  authentication.
126         #
127         #  It also sets the EAP-Type attribute in the request
128         #  attribute list to the EAP type from the packet.
129         #
130         #  As of 2.0, the EAP module returns "ok" in the authorize stage
131         #  for TTLS and PEAP.  In 1.x, it never returned "ok" here, so
132         #  this change is compatible with older configurations.
133         #
134         #  The example below uses module failover to avoid querying all
135         #  of the following modules if the EAP module returns "ok".
136         #  Therefore, your LDAP and/or SQL servers will not be queried
137         #  for the many packets that go back and forth to set up TTLS
138         #  or PEAP.  The load on those servers will therefore be reduced.
139         #
140         eap {
141                 ok = return
142         }
143
144         #
145         #  Pull crypt'd passwords from /etc/passwd or /etc/shadow,
146         #  using the system API's to get the password.  If you want
147         #  to read /etc/passwd or /etc/shadow directly, see the
148         #  passwd module in radiusd.conf.
149         #
150         unix
151
152         #
153         #  Read the 'users' file
154         files
155
156         #
157         #  Look in an SQL database.  The schema of the database
158         #  is meant to mirror the "users" file.
159         #
160         #  See "Authorization Queries" in sql.conf
161 #       sql
162
163         #
164         #  If you are using /etc/smbpasswd, and are also doing
165         #  mschap authentication, the un-comment this line, and
166         #  configure the 'etc_smbpasswd' module, above.
167 #       etc_smbpasswd
168
169         #
170         #  The ldap module will set Auth-Type to LDAP if it has not
171         #  already been set
172 #       ldap
173
174         #
175         #  Enforce daily limits on time spent logged in.
176 #       daily
177
178         #
179         # Use the checkval module
180 #       checkval
181
182         expiration
183         logintime
184
185         #
186         #  If no other module has claimed responsibility for
187         #  authentication, then try to use PAP.  This allows the
188         #  other modules listed above to add a "known good" password
189         #  to the request, and to do nothing else.  The PAP module
190         #  will then see that password, and use it to do PAP
191         #  authentication.
192         #
193         #  This module should be listed last, so that the other modules
194         #  get a chance to set Auth-Type for themselves.
195         #
196         pap
197
198         #
199         #  If "status_server = yes", then Status-Server messages are passed
200         #  through the following section, and ONLY the following section.
201         #  This permits you to do DB queries, for example.  If the modules
202         #  listed here return "fail", then NO response is sent.
203         #
204 #       Autz-Type Status-Server {
205 #
206 #       }
207 }
208
209
210 #  Authentication.
211 #
212 #
213 #  This section lists which modules are available for authentication.
214 #  Note that it does NOT mean 'try each module in order'.  It means
215 #  that a module from the 'authorize' section adds a configuration
216 #  attribute 'Auth-Type := FOO'.  That authentication type is then
217 #  used to pick the apropriate module from the list below.
218 #
219
220 #  In general, you SHOULD NOT set the Auth-Type attribute.  The server
221 #  will figure it out on its own, and will do the right thing.  The
222 #  most common side effect of erroneously setting the Auth-Type
223 #  attribute is that one authentication method will work, but the
224 #  others will not.
225 #
226 #  The common reasons to set the Auth-Type attribute by hand
227 #  is to either forcibly reject the user (Auth-Type := Reject),
228 #  or to or forcibly accept the user (Auth-Type := Accept).
229 #
230 #  Note that Auth-Type := Accept will NOT work with EAP.
231 #
232 #  Please do not put "unlang" configurations into the "authenticate"
233 #  section.  Put them in the "post-auth" section instead.  That's what
234 #  the post-auth section is for.
235 #
236 authenticate {
237         #
238         #  PAP authentication, when a back-end database listed
239         #  in the 'authorize' section supplies a password.  The
240         #  password can be clear-text, or encrypted.
241         Auth-Type PAP {
242                 pap
243         }
244
245         #
246         #  Most people want CHAP authentication
247         #  A back-end database listed in the 'authorize' section
248         #  MUST supply a CLEAR TEXT password.  Encrypted passwords
249         #  won't work.
250         Auth-Type CHAP {
251                 chap
252         }
253
254         #
255         #  MSCHAP authentication.
256         Auth-Type MS-CHAP {
257                 mschap
258         }
259
260         #
261         #  If you have a Cisco SIP server authenticating against
262         #  FreeRADIUS, uncomment the following line, and the 'digest'
263         #  line in the 'authorize' section.
264 #       digest
265
266         #
267         #  Pluggable Authentication Modules.
268 #       pam
269
270         #
271         #  See 'man getpwent' for information on how the 'unix'
272         #  module checks the users password.  Note that packets
273         #  containing CHAP-Password attributes CANNOT be authenticated
274         #  against /etc/passwd!  See the FAQ for details.
275         #  
276         unix
277
278         # Uncomment it if you want to use ldap for authentication
279         #
280         # Note that this means "check plain-text password against
281         # the ldap database", which means that EAP won't work,
282         # as it does not supply a plain-text password.
283 #       Auth-Type LDAP {
284 #               ldap
285 #       }
286
287         #
288         #  Allow EAP authentication.
289         eap
290 }
291
292
293 #
294 #  Pre-accounting.  Decide which accounting type to use.
295 #
296 preacct {
297         preprocess
298
299         #
300         #  Ensure that we have a semi-unique identifier for every
301         #  request, and many NAS boxes are broken.
302         acct_unique
303
304         #
305         #  Look for IPASS-style 'realm/', and if not found, look for
306         #  '@realm', and decide whether or not to proxy, based on
307         #  that.
308         #
309         #  Accounting requests are generally proxied to the same
310         #  home server as authentication requests.
311 #       IPASS
312         suffix
313 #       ntdomain
314
315         #
316         #  Read the 'acct_users' file
317         files
318 }
319
320 #
321 #  Accounting.  Log the accounting data.
322 #
323 accounting {
324         #
325         #  Create a 'detail'ed log of the packets.
326         #  Note that accounting requests which are proxied
327         #  are also logged in the detail file.
328         detail
329 #       daily
330
331         #  Update the wtmp file
332         #
333         #  If you don't use "radlast", you can delete this line.
334         unix
335
336         #
337         #  For Simultaneous-Use tracking.
338         #
339         #  Due to packet losses in the network, the data here
340         #  may be incorrect.  There is little we can do about it.
341         radutmp
342 #       sradutmp
343
344         #  Return an address to the IP Pool when we see a stop record.
345 #       main_pool
346
347         #
348         #  Log traffic to an SQL database.
349         #
350         #  See "Accounting queries" in sql.conf
351 #       sql
352
353         #
354         #  Instead of sending the query to the SQL server,
355         #  write it into a log file.
356         #
357 #       sql_log
358
359         #  Cisco VoIP specific bulk accounting
360 #       pgsql-voip
361
362         #  Filter attributes from the accounting response.
363         attr_filter.accounting_response
364
365         #
366         #  See "Autz-Type Status-Server" for how this works.
367         #
368 #       Acct-Type Status-Server {
369 #
370 #       }
371 }
372
373
374 #  Session database, used for checking Simultaneous-Use. Either the radutmp 
375 #  or rlm_sql module can handle this.
376 #  The rlm_sql module is *much* faster
377 session {
378         radutmp
379
380         #
381         #  See "Simultaneous Use Checking Queries" in sql.conf
382 #       sql
383 }
384
385
386 #  Post-Authentication
387 #  Once we KNOW that the user has been authenticated, there are
388 #  additional steps we can take.
389 post-auth {
390         #  Get an address from the IP Pool.
391 #       main_pool
392
393         #
394         #  If you want to have a log of authentication replies,
395         #  un-comment the following line, and the 'detail reply_log'
396         #  section, above.
397 #       reply_log
398
399         #
400         #  After authenticating the user, do another SQL query.
401         #
402         #  See "Authentication Logging Queries" in sql.conf
403 #       sql
404
405         #
406         #  Instead of sending the query to the SQL server,
407         #  write it into a log file.
408         #
409 #       sql_log
410
411         #
412         #  Un-comment the following if you have set
413         #  'edir_account_policy_check = yes' in the ldap module sub-section of
414         #  the 'modules' section.
415         #
416 #       ldap
417
418         exec
419
420         #
421         #  Calculate the various WiMAX keys.  In order for this to work,
422         #  you will need to define the WiMAX NAI, usually via
423         #
424         #       update request {
425         #              WiMAX-MN-NAI = "%{User-Name}"
426         #       }
427         #
428         #  If you want various keys to be calculated, you will need to
429         #  update the reply with "template" values.  The module will see
430         #  this, and replace the template values with the correct ones
431         #  taken from the cryptographic calculations.  e.g.
432         #
433         #       update reply {
434         #               WiMAX-FA-RK-Key = 0x00
435         #               WiMAX-MSK = "%{EAP-MSK}"
436         #       }
437         #
438         #  You may want to delete the MS-MPPE-*-Keys from the reply,
439         #  as some WiMAX clients behave badly when those attributes
440         #  are included.  See "raddb/modules/wimax", configuration
441         #  entry "delete_mppe_keys" for more information.
442         #
443 #       wimax
444
445         #  If the WiMAX module did it's work, you may want to do more
446         #  things here, like delete the MS-MPPE-*-Key attributes.
447         #
448         #       if (updated) {
449         #               update reply {
450         #                       MS-MPPE-Recv-Key !* 0x00
451         #                       MS-MPPE-Send-Key !* 0x00
452         #               }
453         #       }
454
455         #
456         #  Access-Reject packets are sent through the REJECT sub-section of the
457         #  post-auth section.
458         #
459         #  Add the ldap module name (or instance) if you have set 
460         #  'edir_account_policy_check = yes' in the ldap module configuration
461         #
462         Post-Auth-Type REJECT {
463                 attr_filter.access_reject
464         }
465 }
466
467 #
468 #  When the server decides to proxy a request to a home server,
469 #  the proxied request is first passed through the pre-proxy
470 #  stage.  This stage can re-write the request, or decide to
471 #  cancel the proxy.
472 #
473 #  Only a few modules currently have this method.
474 #
475 pre-proxy {
476 #       attr_rewrite
477
478         #  Uncomment the following line if you want to change attributes
479         #  as defined in the preproxy_users file.
480 #       files
481
482         #  Uncomment the following line if you want to filter requests
483         #  sent to remote servers based on the rules defined in the
484         #  'attrs.pre-proxy' file.
485 #       attr_filter.pre-proxy
486
487         #  If you want to have a log of packets proxied to a home
488         #  server, un-comment the following line, and the
489         #  'detail pre_proxy_log' section, above.
490 #       pre_proxy_log
491 }
492
493 #
494 #  When the server receives a reply to a request it proxied
495 #  to a home server, the request may be massaged here, in the
496 #  post-proxy stage.
497 #
498 post-proxy {
499
500         #  If you want to have a log of replies from a home server,
501         #  un-comment the following line, and the 'detail post_proxy_log'
502         #  section, above.
503 #       post_proxy_log
504
505 #       attr_rewrite
506
507         #  Uncomment the following line if you want to filter replies from
508         #  remote proxies based on the rules defined in the 'attrs' file.
509 #       attr_filter.post-proxy
510
511         #
512         #  If you are proxying LEAP, you MUST configure the EAP
513         #  module, and you MUST list it here, in the post-proxy
514         #  stage.
515         #
516         #  You MUST also use the 'nostrip' option in the 'realm'
517         #  configuration.  Otherwise, the User-Name attribute
518         #  in the proxied request will not match the user name
519         #  hidden inside of the EAP packet, and the end server will
520         #  reject the EAP request.
521         #
522         eap
523
524         #
525         #  If the server tries to proxy a request and fails, then the
526         #  request is processed through the modules in this section.
527         #
528         #  The main use of this section is to permit robust proxying
529         #  of accounting packets.  The server can be configured to
530         #  proxy accounting packets as part of normal processing.
531         #  Then, if the home server goes down, accounting packets can
532         #  be logged to a local "detail" file, for processing with
533         #  radrelay.  When the home server comes back up, radrelay
534         #  will read the detail file, and send the packets to the
535         #  home server.
536         #
537         #  With this configuration, the server always responds to
538         #  Accounting-Requests from the NAS, but only writes
539         #  accounting packets to disk if the home server is down.
540         #
541 #       Post-Proxy-Type Fail {
542 #                       detail
543 #       }
544
545 }
546