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