Fix typo in error message
[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         preprocess
71
72         #
73         #  If you want to have a log of authentication requests,
74         #  un-comment the following line, and the 'detail auth_log'
75         #  section, above.
76 #       auth_log
77
78         #
79         #  The chap module will set 'Auth-Type := CHAP' if we are
80         #  handling a CHAP request and Auth-Type has not already been set
81         chap
82
83         #
84         #  If the users are logging in with an MS-CHAP-Challenge
85         #  attribute for authentication, the mschap module will find
86         #  the MS-CHAP-Challenge attribute, and add 'Auth-Type := MS-CHAP'
87         #  to the request, which will cause the server to then use
88         #  the mschap module for authentication.
89         mschap
90
91         #
92         #  If you have a Cisco SIP server authenticating against
93         #  FreeRADIUS, uncomment the following line, and the 'digest'
94         #  line in the 'authenticate' section.
95         digest
96
97         #
98         #  The WiMAX specification says that the Calling-Station-Id
99         #  is 6 octets of the MAC.  This definition conflicts with
100         #  RFC 3580, and all common RADIUS practices.  Un-commenting
101         #  the "wimax" module here means that it will fix the
102         #  Calling-Station-Id attribute to the normal format as
103         #  specified in RFC 3580 Section 3.21
104 #       wimax
105
106         #
107         #  Look for IPASS style 'realm/', and if not found, look for
108         #  '@realm', and decide whether or not to proxy, based on
109         #  that.
110 #       IPASS
111
112         #
113         #  If you are using multiple kinds of realms, you probably
114         #  want to set "ignore_null = yes" for all of them.
115         #  Otherwise, when the first style of realm doesn't match,
116         #  the other styles won't be checked.
117         #
118         suffix
119 #       ntdomain
120
121         #
122         #  This module takes care of EAP-MD5, EAP-TLS, and EAP-LEAP
123         #  authentication.
124         #
125         #  It also sets the EAP-Type attribute in the request
126         #  attribute list to the EAP type from the packet.
127         #
128         #  As of 2.0, the EAP module returns "ok" in the authorize stage
129         #  for TTLS and PEAP.  In 1.x, it never returned "ok" here, so
130         #  this change is compatible with older configurations.
131         #
132         #  The example below uses module failover to avoid querying all
133         #  of the following modules if the EAP module returns "ok".
134         #  Therefore, your LDAP and/or SQL servers will not be queried
135         #  for the many packets that go back and forth to set up TTLS
136         #  or PEAP.  The load on those servers will therefore be reduced.
137         #
138         eap {
139                 ok = return
140         }
141
142         #
143         #  Pull crypt'd passwords from /etc/passwd or /etc/shadow,
144         #  using the system API's to get the password.  If you want
145         #  to read /etc/passwd or /etc/shadow directly, see the
146         #  passwd module in radiusd.conf.
147         #
148 #       unix
149
150         #
151         #  Read the 'users' file
152         files
153
154         #
155         #  Look in an SQL database.  The schema of the database
156         #  is meant to mirror the "users" file.
157         #
158         #  See "Authorization Queries" in sql.conf
159 #       sql
160
161         #
162         #  If you are using /etc/smbpasswd, and are also doing
163         #  mschap authentication, the un-comment this line, and
164         #  configure the 'etc_smbpasswd' module, above.
165 #       etc_smbpasswd
166
167         #
168         #  The ldap module will set Auth-Type to LDAP if it has not
169         #  already been set
170 #       ldap
171
172         #
173         #  Enforce daily limits on time spent logged in.
174 #       daily
175
176         #
177         # Use the checkval module
178 #       checkval
179
180         expiration
181         logintime
182
183         #
184         #  If no other module has claimed responsibility for
185         #  authentication, then try to use PAP.  This allows the
186         #  other modules listed above to add a "known good" password
187         #  to the request, and to do nothing else.  The PAP module
188         #  will then see that password, and use it to do PAP
189         #  authentication.
190         #
191         #  This module should be listed last, so that the other modules
192         #  get a chance to set Auth-Type for themselves.
193         #
194         pap
195
196         #
197         #  If "status_server = yes", then Status-Server messages are passed
198         #  through the following section, and ONLY the following section.
199         #  This permits you to do DB queries, for example.  If the modules
200         #  listed here return "fail", then NO response is sent.
201         #
202 #       Autz-Type Status-Server {
203 #
204 #       }
205 }
206
207
208 #  Authentication.
209 #
210 #
211 #  This section lists which modules are available for authentication.
212 #  Note that it does NOT mean 'try each module in order'.  It means
213 #  that a module from the 'authorize' section adds a configuration
214 #  attribute 'Auth-Type := FOO'.  That authentication type is then
215 #  used to pick the apropriate module from the list below.
216 #
217
218 #  In general, you SHOULD NOT set the Auth-Type attribute.  The server
219 #  will figure it out on its own, and will do the right thing.  The
220 #  most common side effect of erroneously setting the Auth-Type
221 #  attribute is that one authentication method will work, but the
222 #  others will not.
223 #
224 #  The common reasons to set the Auth-Type attribute by hand
225 #  is to either forcibly reject the user (Auth-Type := Reject),
226 #  or to or forcibly accept the user (Auth-Type := Accept).
227 #
228 #  Note that Auth-Type := Accept will NOT work with EAP.
229 #
230 #  Please do not put "unlang" configurations into the "authenticate"
231 #  section.  Put them in the "post-auth" section instead.  That's what
232 #  the post-auth section is for.
233 #
234 authenticate {
235         #
236         #  PAP authentication, when a back-end database listed
237         #  in the 'authorize' section supplies a password.  The
238         #  password can be clear-text, or encrypted.
239         Auth-Type PAP {
240                 pap
241         }
242
243         #
244         #  Most people want CHAP authentication
245         #  A back-end database listed in the 'authorize' section
246         #  MUST supply a CLEAR TEXT password.  Encrypted passwords
247         #  won't work.
248         Auth-Type CHAP {
249                 chap
250         }
251
252         #
253         #  MSCHAP authentication.
254         Auth-Type MS-CHAP {
255                 mschap
256         }
257
258         #
259         #  If you have a Cisco SIP server authenticating against
260         #  FreeRADIUS, uncomment the following line, and the 'digest'
261         #  line in the 'authorize' section.
262         digest
263
264         #
265         #  Pluggable Authentication Modules.
266 #       pam
267
268         #
269         #  See 'man getpwent' for information on how the 'unix'
270         #  module checks the users password.  Note that packets
271         #  containing CHAP-Password attributes CANNOT be authenticated
272         #  against /etc/passwd!  See the FAQ for details.
273         #
274         #  For normal "crypt" authentication, the "pap" module should
275         #  be used instead of the "unix" module.  The "unix" module should
276         #  be used for authentication ONLY for compatibility with legacy
277         #  FreeRADIUS configurations.
278         #
279         unix
280
281         # Uncomment it if you want to use ldap for authentication
282         #
283         # Note that this means "check plain-text password against
284         # the ldap database", which means that EAP won't work,
285         # as it does not supply a plain-text password.
286 #       Auth-Type LDAP {
287 #               ldap
288 #       }
289
290         #
291         #  Allow EAP authentication.
292         eap
293
294         #
295         #  The older configurations sent a number of attributes in
296         #  Access-Challenge packets, which wasn't strictly correct.
297         #  If you want to filter out these attributes, uncomment
298         #  the following lines.
299         #
300 #       Auth-Type eap {
301 #               eap {
302 #                       handled = 1  
303 #               }
304 #               if (handled && (Response-Packet-Type == Access-Challenge)) {
305 #                       attr_filter.access_challenge.post-auth
306 #                       handled  # override the "updated" code from attr_filter
307 #               }
308 #       }
309 }
310
311
312 #
313 #  Pre-accounting.  Decide which accounting type to use.
314 #
315 preacct {
316         preprocess
317
318         #
319         #  Session start times are *implied* in RADIUS.
320         #  The NAS never sends a "start time".  Instead, it sends
321         #  a start packet, *possibly* with an Acct-Delay-Time.
322         #  The server is supposed to conclude that the start time
323         #  was "Acct-Delay-Time" seconds in the past.
324         #
325         #  The code below creates an explicit start time, which can
326         #  then be used in other modules.
327         #
328         #  The start time is: NOW - delay - session_length
329         #
330
331 #         update request {
332 #               FreeRADIUS-Acct-Session-Start-Time = "%{expr: %l - %{%{Acct-Session-Time}:-0} - %{%{Acct-Delay-Time}:-0}}"
333 #       }
334
335
336         #
337         #  Ensure that we have a semi-unique identifier for every
338         #  request, and many NAS boxes are broken.
339         acct_unique
340
341         #
342         #  Look for IPASS-style 'realm/', and if not found, look for
343         #  '@realm', and decide whether or not to proxy, based on
344         #  that.
345         #
346         #  Accounting requests are generally proxied to the same
347         #  home server as authentication requests.
348 #       IPASS
349         suffix
350 #       ntdomain
351
352         #
353         #  Read the 'acct_users' file
354         files
355 }
356
357 #
358 #  Accounting.  Log the accounting data.
359 #
360 accounting {
361         #
362         #  Create a 'detail'ed log of the packets.
363         #  Note that accounting requests which are proxied
364         #  are also logged in the detail file.
365         detail
366 #       daily
367
368         #  Update the wtmp file
369         #
370         #  If you don't use "radlast", you can delete this line.
371         unix
372
373         #
374         #  For Simultaneous-Use tracking.
375         #
376         #  Due to packet losses in the network, the data here
377         #  may be incorrect.  There is little we can do about it.
378         radutmp
379 #       sradutmp
380
381         #  Return an address to the IP Pool when we see a stop record.
382 #       main_pool
383
384         #
385         #  Log traffic to an SQL database.
386         #
387         #  See "Accounting queries" in sql.conf
388 #       sql
389
390         #
391         #  If you receive stop packets with zero session length,
392         #  they will NOT be logged in the database.  The SQL module
393         #  will print a message (only in debugging mode), and will
394         #  return "noop".
395         #
396         #  You can ignore these packets by uncommenting the following
397         #  three lines.  Otherwise, the server will not respond to the
398         #  accounting request, and the NAS will retransmit.
399         #
400 #       if (noop) {
401 #               ok
402 #       }
403
404         #
405         #  Instead of sending the query to the SQL server,
406         #  write it into a log file.
407         #
408 #       sql_log
409
410         #  Cisco VoIP specific bulk accounting
411 #       pgsql-voip
412
413         # For Exec-Program and Exec-Program-Wait
414         exec
415
416         #  Filter attributes from the accounting response.
417         attr_filter.accounting_response
418
419         #
420         #  See "Autz-Type Status-Server" for how this works.
421         #
422 #       Acct-Type Status-Server {
423 #
424 #       }
425 }
426
427
428 #  Session database, used for checking Simultaneous-Use. Either the radutmp 
429 #  or rlm_sql module can handle this.
430 #  The rlm_sql module is *much* faster
431 session {
432         radutmp
433
434         #
435         #  See "Simultaneous Use Checking Queries" in sql.conf
436 #       sql
437 }
438
439
440 #  Post-Authentication
441 #  Once we KNOW that the user has been authenticated, there are
442 #  additional steps we can take.
443 post-auth {
444         #  Get an address from the IP Pool.
445 #       main_pool
446
447         #
448         #  If you want to have a log of authentication replies,
449         #  un-comment the following line, and the 'detail reply_log'
450         #  section, above.
451 #       reply_log
452
453         #
454         #  After authenticating the user, do another SQL query.
455         #
456         #  See "Authentication Logging Queries" in sql.conf
457 #       sql
458
459         #
460         #  Instead of sending the query to the SQL server,
461         #  write it into a log file.
462         #
463 #       sql_log
464
465         #
466         #  Un-comment the following if you have set
467         #  'edir_account_policy_check = yes' in the ldap module sub-section of
468         #  the 'modules' section.
469         #
470 #       ldap
471
472         # For Exec-Program and Exec-Program-Wait
473         exec
474
475         #
476         #  Calculate the various WiMAX keys.  In order for this to work,
477         #  you will need to define the WiMAX NAI, usually via
478         #
479         #       update request {
480         #              WiMAX-MN-NAI = "%{User-Name}"
481         #       }
482         #
483         #  If you want various keys to be calculated, you will need to
484         #  update the reply with "template" values.  The module will see
485         #  this, and replace the template values with the correct ones
486         #  taken from the cryptographic calculations.  e.g.
487         #
488         #       update reply {
489         #               WiMAX-FA-RK-Key = 0x00
490         #               WiMAX-MSK = "%{EAP-MSK}"
491         #       }
492         #
493         #  You may want to delete the MS-MPPE-*-Keys from the reply,
494         #  as some WiMAX clients behave badly when those attributes
495         #  are included.  See "raddb/modules/wimax", configuration
496         #  entry "delete_mppe_keys" for more information.
497         #
498 #       wimax
499
500         #  If there is a client certificate (EAP-TLS, sometimes PEAP
501         #  and TTLS), then some attributes are filled out after the
502         #  certificate verification has been performed.  These fields
503         #  MAY be available during the authentication, or they may be
504         #  available only in the "post-auth" section.
505         #
506         #  The first set of attributes contains information about the
507         #  issuing certificate which is being used.  The second
508         #  contains information about the client certificate (if
509         #  available).
510 #
511 #       update reply {
512 #              Reply-Message += "%{TLS-Cert-Serial}"
513 #              Reply-Message += "%{TLS-Cert-Expiration}"
514 #              Reply-Message += "%{TLS-Cert-Subject}"
515 #              Reply-Message += "%{TLS-Cert-Issuer}"
516 #              Reply-Message += "%{TLS-Cert-Common-Name}"
517 #
518 #              Reply-Message += "%{TLS-Client-Cert-Serial}"
519 #              Reply-Message += "%{TLS-Client-Cert-Expiration}"
520 #              Reply-Message += "%{TLS-Client-Cert-Subject}"
521 #              Reply-Message += "%{TLS-Client-Cert-Issuer}"
522 #              Reply-Message += "%{TLS-Client-Cert-Common-Name}"
523 #       }
524
525
526         #  If the WiMAX module did it's work, you may want to do more
527         #  things here, like delete the MS-MPPE-*-Key attributes.
528         #
529         #       if (updated) {
530         #               update reply {
531         #                       MS-MPPE-Recv-Key !* 0x00
532         #                       MS-MPPE-Send-Key !* 0x00
533         #               }
534         #       }
535
536         #
537         #  Access-Reject packets are sent through the REJECT sub-section of the
538         #  post-auth section.
539         #
540         #  Add the ldap module name (or instance) if you have set 
541         #  'edir_account_policy_check = yes' in the ldap module configuration
542         #
543         Post-Auth-Type REJECT {
544                 # log failed authentications in SQL, too.
545 #               sql
546                 attr_filter.access_reject
547         }
548 }
549
550 #
551 #  When the server decides to proxy a request to a home server,
552 #  the proxied request is first passed through the pre-proxy
553 #  stage.  This stage can re-write the request, or decide to
554 #  cancel the proxy.
555 #
556 #  Only a few modules currently have this method.
557 #
558 pre-proxy {
559 #       attr_rewrite
560
561         #  Uncomment the following line if you want to change attributes
562         #  as defined in the preproxy_users file.
563 #       files
564
565         #  Uncomment the following line if you want to filter requests
566         #  sent to remote servers based on the rules defined in the
567         #  'attrs.pre-proxy' file.
568 #       attr_filter.pre-proxy
569
570         #  If you want to have a log of packets proxied to a home
571         #  server, un-comment the following line, and the
572         #  'detail pre_proxy_log' section, above.
573 #       pre_proxy_log
574 }
575
576 #
577 #  When the server receives a reply to a request it proxied
578 #  to a home server, the request may be massaged here, in the
579 #  post-proxy stage.
580 #
581 post-proxy {
582
583         #  If you want to have a log of replies from a home server,
584         #  un-comment the following line, and the 'detail post_proxy_log'
585         #  section, above.
586 #       post_proxy_log
587
588 #       attr_rewrite
589
590         #  Uncomment the following line if you want to filter replies from
591         #  remote proxies based on the rules defined in the 'attrs' file.
592 #       attr_filter.post-proxy
593
594         #
595         #  If you are proxying LEAP, you MUST configure the EAP
596         #  module, and you MUST list it here, in the post-proxy
597         #  stage.
598         #
599         #  You MUST also use the 'nostrip' option in the 'realm'
600         #  configuration.  Otherwise, the User-Name attribute
601         #  in the proxied request will not match the user name
602         #  hidden inside of the EAP packet, and the end server will
603         #  reject the EAP request.
604         #
605         eap
606
607         #
608         #  If the server tries to proxy a request and fails, then the
609         #  request is processed through the modules in this section.
610         #
611         #  The main use of this section is to permit robust proxying
612         #  of accounting packets.  The server can be configured to
613         #  proxy accounting packets as part of normal processing.
614         #  Then, if the home server goes down, accounting packets can
615         #  be logged to a local "detail" file, for processing with
616         #  radrelay.  When the home server comes back up, radrelay
617         #  will read the detail file, and send the packets to the
618         #  home server.
619         #
620         #  With this configuration, the server always responds to
621         #  Accounting-Requests from the NAS, but only writes
622         #  accounting packets to disk if the home server is down.
623         #
624 #       Post-Proxy-Type Fail {
625 #                       detail
626 #       }
627 }
628