Re-enabled Exec-Program and Exec-Program-Wait for accounting packets
[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         unix
275
276         # Uncomment it if you want to use ldap for authentication
277         #
278         # Note that this means "check plain-text password against
279         # the ldap database", which means that EAP won't work,
280         # as it does not supply a plain-text password.
281 #       Auth-Type LDAP {
282 #               ldap
283 #       }
284
285         #
286         #  Allow EAP authentication.
287         eap
288
289         #
290         #  The older configurations sent a number of attributes in
291         #  Access-Challenge packets, which wasn't strictly correct.
292         #  If you want to filter out these attributes, uncomment
293         #  the following lines.
294         #
295 #       Auth-Type eap {
296 #               eap {
297 #                       handled = 1  
298 #               }
299 #               if (handled && (Response-Packet-Type == Access-Challenge)) {
300 #                       attr_filter.access_challenge.post-auth
301 #                       handled  # override the "updated" code from attr_filter
302 #               }
303 #       }
304 }
305
306
307 #
308 #  Pre-accounting.  Decide which accounting type to use.
309 #
310 preacct {
311         preprocess
312
313         #
314         #  Session start times are *implied* in RADIUS.
315         #  The NAS never sends a "start time".  Instead, it sends
316         #  a start packet, *possibly* with an Acct-Delay-Time.
317         #  The server is supposed to conclude that the start time
318         #  was "Acct-Delay-Time" seconds in the past.
319         #
320         #  The code below creates an explicit start time, which can
321         #  then be used in other modules.
322         #
323         #  The start time is: NOW - delay - session_length
324         #
325
326 #         update request {
327 #               FreeRADIUS-Acct-Session-Start-Time = "%{expr: %l - %{%{Acct-Session-Time}:-0} - %{%{Acct-Delay-Time}:-0}}"
328 #       }
329
330
331         #
332         #  Ensure that we have a semi-unique identifier for every
333         #  request, and many NAS boxes are broken.
334         acct_unique
335
336         #
337         #  Look for IPASS-style 'realm/', and if not found, look for
338         #  '@realm', and decide whether or not to proxy, based on
339         #  that.
340         #
341         #  Accounting requests are generally proxied to the same
342         #  home server as authentication requests.
343 #       IPASS
344         suffix
345 #       ntdomain
346
347         #
348         #  Read the 'acct_users' file
349         files
350 }
351
352 #
353 #  Accounting.  Log the accounting data.
354 #
355 accounting {
356         #
357         #  Create a 'detail'ed log of the packets.
358         #  Note that accounting requests which are proxied
359         #  are also logged in the detail file.
360         detail
361 #       daily
362
363         #  Update the wtmp file
364         #
365         #  If you don't use "radlast", you can delete this line.
366         unix
367
368         #
369         #  For Simultaneous-Use tracking.
370         #
371         #  Due to packet losses in the network, the data here
372         #  may be incorrect.  There is little we can do about it.
373         radutmp
374 #       sradutmp
375
376         #  Return an address to the IP Pool when we see a stop record.
377 #       main_pool
378
379         #
380         #  Log traffic to an SQL database.
381         #
382         #  See "Accounting queries" in sql.conf
383 #       sql
384
385         #
386         #  If you receive stop packets with zero session length,
387         #  they will NOT be logged in the database.  The SQL module
388         #  will print a message (only in debugging mode), and will
389         #  return "noop".
390         #
391         #  You can ignore these packets by uncommenting the following
392         #  three lines.  Otherwise, the server will not respond to the
393         #  accounting request, and the NAS will retransmit.
394         #
395 #       if (noop) {
396 #               ok
397 #       }
398
399         #
400         #  Instead of sending the query to the SQL server,
401         #  write it into a log file.
402         #
403 #       sql_log
404
405         #  Cisco VoIP specific bulk accounting
406 #       pgsql-voip
407
408         # For Exec-Program and Exec-Program-Wait
409         exec
410
411         #  Filter attributes from the accounting response.
412         attr_filter.accounting_response
413
414         #
415         #  See "Autz-Type Status-Server" for how this works.
416         #
417 #       Acct-Type Status-Server {
418 #
419 #       }
420 }
421
422
423 #  Session database, used for checking Simultaneous-Use. Either the radutmp 
424 #  or rlm_sql module can handle this.
425 #  The rlm_sql module is *much* faster
426 session {
427         radutmp
428
429         #
430         #  See "Simultaneous Use Checking Queries" in sql.conf
431 #       sql
432 }
433
434
435 #  Post-Authentication
436 #  Once we KNOW that the user has been authenticated, there are
437 #  additional steps we can take.
438 post-auth {
439         #  Get an address from the IP Pool.
440 #       main_pool
441
442         #
443         #  If you want to have a log of authentication replies,
444         #  un-comment the following line, and the 'detail reply_log'
445         #  section, above.
446 #       reply_log
447
448         #
449         #  After authenticating the user, do another SQL query.
450         #
451         #  See "Authentication Logging Queries" in sql.conf
452 #       sql
453
454         #
455         #  Instead of sending the query to the SQL server,
456         #  write it into a log file.
457         #
458 #       sql_log
459
460         #
461         #  Un-comment the following if you have set
462         #  'edir_account_policy_check = yes' in the ldap module sub-section of
463         #  the 'modules' section.
464         #
465 #       ldap
466
467         # For Exec-Program and Exec-Program-Wait
468         exec
469
470         #
471         #  Calculate the various WiMAX keys.  In order for this to work,
472         #  you will need to define the WiMAX NAI, usually via
473         #
474         #       update request {
475         #              WiMAX-MN-NAI = "%{User-Name}"
476         #       }
477         #
478         #  If you want various keys to be calculated, you will need to
479         #  update the reply with "template" values.  The module will see
480         #  this, and replace the template values with the correct ones
481         #  taken from the cryptographic calculations.  e.g.
482         #
483         #       update reply {
484         #               WiMAX-FA-RK-Key = 0x00
485         #               WiMAX-MSK = "%{EAP-MSK}"
486         #       }
487         #
488         #  You may want to delete the MS-MPPE-*-Keys from the reply,
489         #  as some WiMAX clients behave badly when those attributes
490         #  are included.  See "raddb/modules/wimax", configuration
491         #  entry "delete_mppe_keys" for more information.
492         #
493 #       wimax
494
495         #  If the WiMAX module did it's work, you may want to do more
496         #  things here, like delete the MS-MPPE-*-Key attributes.
497         #
498         #       if (updated) {
499         #               update reply {
500         #                       MS-MPPE-Recv-Key !* 0x00
501         #                       MS-MPPE-Send-Key !* 0x00
502         #               }
503         #       }
504
505         #
506         #  Access-Reject packets are sent through the REJECT sub-section of the
507         #  post-auth section.
508         #
509         #  Add the ldap module name (or instance) if you have set 
510         #  'edir_account_policy_check = yes' in the ldap module configuration
511         #
512         Post-Auth-Type REJECT {
513                 # log failed authentications in SQL, too.
514 #               sql
515                 attr_filter.access_reject
516         }
517 }
518
519 #
520 #  When the server decides to proxy a request to a home server,
521 #  the proxied request is first passed through the pre-proxy
522 #  stage.  This stage can re-write the request, or decide to
523 #  cancel the proxy.
524 #
525 #  Only a few modules currently have this method.
526 #
527 pre-proxy {
528 #       attr_rewrite
529
530         #  Uncomment the following line if you want to change attributes
531         #  as defined in the preproxy_users file.
532 #       files
533
534         #  Uncomment the following line if you want to filter requests
535         #  sent to remote servers based on the rules defined in the
536         #  'attrs.pre-proxy' file.
537 #       attr_filter.pre-proxy
538
539         #  If you want to have a log of packets proxied to a home
540         #  server, un-comment the following line, and the
541         #  'detail pre_proxy_log' section, above.
542 #       pre_proxy_log
543 }
544
545 #
546 #  When the server receives a reply to a request it proxied
547 #  to a home server, the request may be massaged here, in the
548 #  post-proxy stage.
549 #
550 post-proxy {
551
552         #  If you want to have a log of replies from a home server,
553         #  un-comment the following line, and the 'detail post_proxy_log'
554         #  section, above.
555 #       post_proxy_log
556
557 #       attr_rewrite
558
559         #  Uncomment the following line if you want to filter replies from
560         #  remote proxies based on the rules defined in the 'attrs' file.
561 #       attr_filter.post-proxy
562
563         #
564         #  If you are proxying LEAP, you MUST configure the EAP
565         #  module, and you MUST list it here, in the post-proxy
566         #  stage.
567         #
568         #  You MUST also use the 'nostrip' option in the 'realm'
569         #  configuration.  Otherwise, the User-Name attribute
570         #  in the proxied request will not match the user name
571         #  hidden inside of the EAP packet, and the end server will
572         #  reject the EAP request.
573         #
574         eap
575
576         #
577         #  If the server tries to proxy a request and fails, then the
578         #  request is processed through the modules in this section.
579         #
580         #  The main use of this section is to permit robust proxying
581         #  of accounting packets.  The server can be configured to
582         #  proxy accounting packets as part of normal processing.
583         #  Then, if the home server goes down, accounting packets can
584         #  be logged to a local "detail" file, for processing with
585         #  radrelay.  When the home server comes back up, radrelay
586         #  will read the detail file, and send the packets to the
587         #  home server.
588         #
589         #  With this configuration, the server always responds to
590         #  Accounting-Requests from the NAS, but only writes
591         #  accounting packets to disk if the home server is down.
592         #
593 #       Post-Proxy-Type Fail {
594 #                       detail
595 #       }
596 }
597