Initial revision
[freeradius.git] / raddb / modules
1 # -*- text -*-
2 #
3 #  $Id$
4
5 #
6 #  Create a unique accounting session Id.  Many NASes re-use
7 #  or repeat values for Acct-Session-Id, causing no end of
8 #  confusion.
9 #
10 #  This module will add a (probably) unique session id 
11 #  to an accounting packet based on the attributes listed
12 #  below found in the packet.  See doc/rlm_acct_unique for
13 #  more information.
14 #
15 acct_unique {
16         key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port"
17 }
18 # -*- text -*-
19 #
20 #  $Id$
21
22 #
23 # The "always" module is here for debugging purposes. Each
24 # instance simply returns the same result, always, without
25 # doing anything.
26 always fail {
27         rcode = fail
28 }
29 always reject {
30         rcode = reject
31 }
32 always noop {
33         rcode = noop
34 }
35 always handled {
36         rcode = handled
37 }
38 always updated {
39         rcode = updated
40 }
41 always notfound {
42         rcode = notfound
43 }
44 always ok {
45         rcode = ok
46         simulcount = 0
47         mpp = no
48 }
49 # -*- text -*-
50 #
51 #  $Id$
52
53 #
54 #  This file defines a number of instances of the "attr_filter" module.
55 #
56
57 # attr_filter - filters the attributes received in replies from
58 # proxied servers, to make sure we send back to our RADIUS client
59 # only allowed attributes.
60 attr_filter attr_filter.post-proxy {
61         attrsfile = ${confdir}/attrs
62 }
63
64 # attr_filter - filters the attributes in the packets we send to
65 # the RADIUS home servers.
66 attr_filter attr_filter.pre-proxy {
67         attrsfile = ${confdir}/attrs.pre-proxy
68 }
69
70 # Enforce RFC requirements on the contents of Access-Reject
71 # packets.  See the comments at the top of the file for
72 # more details.
73 #
74 attr_filter attr_filter.access_reject {
75         key = %{User-Name}
76         attrsfile = ${confdir}/attrs.access_reject
77 }
78
79 #  Enforce RFC requirements on the contents of the
80 #  Accounting-Response packets.  See the comments at the
81 #  top of the file for more details.
82 #
83 attr_filter attr_filter.accounting_response {
84         key = %{User-Name}
85         attrsfile = ${confdir}/attrs.accounting_response
86 }
87 # -*- text -*-
88 #
89 #  $Id$
90
91 #  rewrite arbitrary packets.  Useful in accounting and authorization.
92 #
93 #  As of 2.0, much of the functionality of this module is in "unlang".
94 #  You should probably investigate using that before trying to use
95 #  the "attr_rewrite" module.
96 #
97 #
98 #  The module can also use the Rewrite-Rule attribute. If it
99 #  is set and matches the name of the module instance, then
100 #  that module instance will be the only one which runs.
101 #
102 #  Also if new_attribute is set to yes then a new attribute
103 #  will be created containing the value replacewith and it
104 #  will be added to searchin (packet, reply, proxy,
105 #  proxy_reply or config).
106 #
107 # searchfor,ignore_case and max_matches will be ignored in that case.
108 #
109 # Backreferences are supported.
110 #       %{0} will contain the string the whole match
111 #       %{1} to %{8} will contain the contents of the 1st to
112 #       the 8th parentheses
113 #
114 # If max_matches is greater than one, the backreferences will
115 # correspond to the first attributed that matched.
116
117 #
118 attr_rewrite sanecallerid {
119         attribute = Called-Station-Id
120         # may be "packet", "reply", "proxy", "proxy_reply" or "config"
121         searchin = packet
122         searchfor = "[+ ]"
123         replacewith = ""
124         ignore_case = no
125         new_attribute = no
126         max_matches = 10
127
128         ## If set to yes then the replace string will be
129         ## appended to the original string
130         append = no
131 }
132
133 # -*- text -*-
134 #
135 #  $Id$
136
137 # CHAP module
138 #
139 #  To authenticate requests containing a CHAP-Password attribute.
140 #
141 chap {
142         # no configuration
143 }
144 # -*- text -*-
145 #
146 #  $Id$
147
148 #  A simple value checking module
149 #
150 #  As of 2.0, much of the functionality of this module is in "unlang".
151 #  You should probably investigate using that before trying to use
152 #  the "checkval" module.
153 #
154 #  It can be used to check if an attribute value in the request
155 #  matches a (possibly multi valued) attribute in the check
156 #  items This can be used for example for caller-id
157 #  authentication.  For the module to run, both the request
158 #  attribute and the check items attribute must exist
159 #
160 #  i.e.
161 #  A user has an ldap entry with 2 radiusCallingStationId
162 #  attributes with values "12345678" and "12345679".  If we
163 #  enable rlm_checkval, then any request which contains a
164 #  Calling-Station-Id with one of those two values will be
165 #  accepted.  Requests with other values for
166 #  Calling-Station-Id will be rejected.
167 #
168 #  Regular expressions in the check attribute value are allowed
169 #  as long as the operator is '=~'
170 #
171 checkval {
172         # The attribute to look for in the request
173         item-name = Calling-Station-Id
174
175         # The attribute to look for in check items. Can be multi valued
176         check-name = Calling-Station-Id
177
178         # The data type. Can be
179         # string,integer,ipaddr,date,abinary,octets
180         data-type = string
181
182         # If set to yes and we dont find the item-name attribute in the
183         # request then we send back a reject
184         # DEFAULT is no
185         #notfound-reject = no
186 }
187         
188 # -*- text -*-
189 #
190 #  $Id$
191
192 #  counter module:
193 #  This module takes an attribute (count-attribute).
194 #  It also takes a key, and creates a counter for each unique
195 #  key.  The count is incremented when accounting packets are
196 #  received by the server.  The value of the increment depends
197 #  on the attribute type.
198 #  If the attribute is Acct-Session-Time or of an integer type we add
199 #  the value of the attribute. If it is anything else we increase the
200 #  counter by one.
201 #
202 #  The 'reset' parameter defines when the counters are all reset to
203 #  zero.  It can be hourly, daily, weekly, monthly or never.
204 #
205 #  hourly: Reset on 00:00 of every hour
206 #  daily: Reset on 00:00:00 every day
207 #  weekly: Reset on 00:00:00 on sunday
208 #  monthly: Reset on 00:00:00 of the first day of each month
209 #
210 #  It can also be user defined. It should be of the form:
211 #  num[hdwm] where:
212 #  h: hours, d: days, w: weeks, m: months
213 #  If the letter is ommited days will be assumed. In example:
214 #  reset = 10h (reset every 10 hours)
215 #  reset = 12  (reset every 12 days)
216 #
217 #
218 #  The check-name attribute defines an attribute which will be
219 #  registered by the counter module and can be used to set the
220 #  maximum allowed value for the counter after which the user
221 #  is rejected.
222 #  Something like:
223 #
224 #  DEFAULT Max-Daily-Session := 36000
225 #          Fall-Through = 1
226 #
227 #  You should add the counter module in the instantiate
228 #  section so that it registers check-name before the files
229 #  module reads the users file.
230 #
231 #  If check-name is set and the user is to be rejected then we
232 #  send back a Reply-Message and we log a Failure-Message in
233 #  the radius.log
234 #
235 #  If the count attribute is Acct-Session-Time then on each
236 #  login we send back the remaining online time as a
237 #  Session-Timeout attribute ELSE and if the reply-name is
238 #  set, we send back that attribute.  The reply-name attribute
239 #  MUST be of an integer type.
240 #
241 #  The counter-name can also be used instead of using the check-name
242 #  like below:
243 #
244 #  DEFAULT  Daily-Session-Time > 3600, Auth-Type = Reject
245 #      Reply-Message = "You've used up more than one hour today"
246 #
247 #  The allowed-servicetype attribute can be used to only take
248 #  into account specific sessions. For example if a user first
249 #  logs in through a login menu and then selects ppp there will
250 #  be two sessions. One for Login-User and one for Framed-User
251 #  service type. We only need to take into account the second one.
252 #
253 #  The module should be added in the instantiate, authorize and
254 #  accounting sections.  Make sure that in the authorize
255 #  section it comes after any module which sets the
256 #  'check-name' attribute.
257 #
258 counter daily {
259         filename = ${db_dir}/db.daily
260         key = User-Name
261         count-attribute = Acct-Session-Time
262         reset = daily
263         counter-name = Daily-Session-Time
264         check-name = Max-Daily-Session
265         reply-name = Session-Timeout
266         allowed-servicetype = Framed-User
267         cache-size = 5000
268 }
269
270 # -*- text -*-
271 #
272 #  $Id$
273
274 # Write a detailed log of all accounting records received.
275 #
276 detail {
277         #  Note that we do NOT use NAS-IP-Address here, as
278         #  that attribute MAY BE from the originating NAS, and
279         #  NOT from the proxy which actually sent us the
280         #  request.  The Client-IP-Address attribute is ALWAYS
281         #  the address of the client which sent us the
282         #  request.
283         #
284         #  The following line creates a new detail file for
285         #  every radius client (by IP address or hostname).
286         #  In addition, a new detail file is created every
287         #  day, so that the detail file doesn't have to go
288         #  through a 'log rotation'
289         #
290         #  If your detail files are large, you may also want
291         #  to add a ':%H' (see doc/variables.txt) to the end
292         #  of it, to create a new detail file every hour, e.g.:
293         #
294         #   ..../detail-%Y%m%d:%H
295         #
296         #  This will create a new detail file for every hour.
297         #
298         detailfile = ${radacctdir}/%{Client-IP-Address}/detail-%Y%m%d
299
300         #
301         #  The Unix-style permissions on the 'detail' file.
302         #
303         #  The detail file often contains secret or private
304         #  information about users.  So by keeping the file
305         #  permissions restrictive, we can prevent unwanted
306         #  people from seeing that information.
307         detailperm = 0600
308
309         #
310         #  Every entry in the detail file has a header which
311         #  is a timestamp.  By default, we use the ctime
312         #  format (see "man ctime" for details).
313         #
314         #  The header can be customized by editing this
315         #  string.  See "doc/variables.txt" for a description
316         #  of what can be put here.
317         #
318         header = "%t"
319
320         #
321         # Certain attributes such as User-Password may be
322         # "sensitive", so they should not be printed in the
323         # detail file.  This section lists the attributes
324         # that should be suppressed.
325         #
326         # The attributes should be listed one to a line.
327         #
328         #suppress {
329                 # User-Password
330         #}
331
332 }
333 # -*- text -*-
334 #
335 #  Detail file writer, used in the following examples:
336 #
337 #       raddb/sites-available/robust-proxy-accounting
338 #       raddb/sites-available/decoupled-accounting
339 #
340 #  Note that this module can write detail files that are read by
341 #  only ONE "listen" section.  If you use BOTH of the examples
342 #  above, you will need to define TWO "detail" modules.
343 #
344 #  e.g. detail1.example.com && detail2.example.com
345 #
346 #
347 #  We write *multiple* detail files here.  They will be processed by
348 #  the detail "listen" section in the order that they were created.
349 #  The directory containing these files should NOT be used for any
350 #  other purposes.  i.e. It should have NO other files in it.
351 #
352 #  Writing multiple detail enables the server to process the pieces
353 #  in smaller chunks.  This helps in certain catastrophic corner cases.
354 #
355 #  $Id$
356 #
357 detail detail.example.com {
358         detailfile = ${radacctdir}/detail.example.com/detail-%Y%m%d:%H
359 }
360 # -*- text -*-
361 #
362 #  $Id$
363
364 #
365 #  More examples of doing detail logs.
366
367 #
368 #  Many people want to log authentication requests.
369 #  Rather than modifying the server core to print out more
370 #  messages, we can use a different instance of the 'detail'
371 #  module, to log the authentication requests to a file.
372 #
373 #  You will also need to un-comment the 'auth_log' line
374 #  in the 'authorize' section, below.
375 #
376 detail auth_log {
377         detailfile = ${radacctdir}/%{Client-IP-Address}/auth-detail-%Y%m%d
378
379         #
380         #  This MUST be 0600, otherwise anyone can read
381         #  the users passwords!
382         detailperm = 0600
383
384         # You may also strip out passwords completely
385         suppress {
386                 User-Password
387         }
388 }
389
390 #
391 #  This module logs authentication reply packets sent
392 #  to a NAS.  Both Access-Accept and Access-Reject packets
393 #  are logged.
394 #
395 #  You will also need to un-comment the 'reply_log' line
396 #  in the 'post-auth' section, below.
397 #
398 detail reply_log {
399         detailfile = ${radacctdir}/%{Client-IP-Address}/reply-detail-%Y%m%d
400
401         detailperm = 0600
402 }
403
404 #
405 #  This module logs packets proxied to a home server.
406 #
407 #  You will also need to un-comment the 'pre_proxy_log' line
408 #  in the 'pre-proxy' section, below.
409 #
410 detail pre_proxy_log {
411         detailfile = ${radacctdir}/%{Client-IP-Address}/pre-proxy-detail-%Y%m%d
412
413         #
414         #  This MUST be 0600, otherwise anyone can read
415         #  the users passwords!
416         detailperm = 0600
417
418         # You may also strip out passwords completely
419         #suppress {
420                 # User-Password
421         #}
422 }
423
424 #
425 #  This module logs response packets from a home server.
426 #
427 #  You will also need to un-comment the 'post_proxy_log' line
428 #  in the 'post-proxy' section, below.
429 #
430 detail post_proxy_log {
431         detailfile = ${radacctdir}/%{Client-IP-Address}/post-proxy-detail-%Y%m%d
432
433         detailperm = 0600
434 }
435 # -*- text -*-
436 #
437 #  $Id$
438
439 #
440 #  The 'digest' module currently has no configuration.
441 #
442 #  "Digest" authentication against a Cisco SIP server.
443 #  See 'doc/rfc/draft-sterman-aaa-sip-00.txt' for details
444 #  on performing digest authentication for Cisco SIP servers.
445 #
446 digest {
447 }
448 # -*- text -*-
449 #
450 #  $Id$
451
452 #
453 #  This is a more general example of the execute module.
454 #
455 #  This one is called "echo".
456 #
457 #  Attribute-Name = `%{echo:/path/to/program args}`
458 #
459 #  If you wish to execute an external program in more than
460 #  one section (e.g. 'authorize', 'pre_proxy', etc), then it
461 #  is probably best to define a different instance of the
462 #  'exec' module for every section.     
463 #
464 #  The return value of the program run determines the result
465 #  of the exec instance call as follows:
466 #  (See doc/configurable_failover for details)
467 #
468 #  < 0 : fail      the module failed
469 #  = 0 : ok        the module succeeded
470 #  = 1 : reject    the module rejected the user
471 #  = 2 : fail      the module failed
472 #  = 3 : ok        the module succeeded
473 #  = 4 : handled   the module has done everything to handle the request
474 #  = 5 : invalid   the user's configuration entry was invalid
475 #  = 6 : userlock  the user was locked out
476 #  = 7 : notfound  the user was not found
477 #  = 8 : noop      the module did nothing
478 #  = 9 : updated   the module updated information in the request
479 #  > 9 : fail      the module failed
480 #
481 exec echo {
482         #
483         #  Wait for the program to finish.
484         #
485         #  If we do NOT wait, then the program is "fire and
486         #  forget", and any output attributes from it are ignored.
487         #
488         #  If we are looking for the program to output
489         #  attributes, and want to add those attributes to the
490         #  request, then we MUST wait for the program to
491         #  finish, and therefore set 'wait=yes'
492         #
493         # allowed values: {no, yes}
494         wait = yes
495
496         #
497         #  The name of the program to execute, and it's
498         #  arguments.  Dynamic translation is done on this
499         #  field, so things like the following example will
500         #  work.
501         #
502         program = "/bin/echo %{User-Name}"
503
504         #
505         #  The attributes which are placed into the
506         #  environment variables for the program.
507         #
508         #  Allowed values are:
509         #
510         #       request         attributes from the request
511         #       config          attributes from the configuration items list
512         #       reply           attributes from the reply
513         #       proxy-request   attributes from the proxy request
514         #       proxy-reply     attributes from the proxy reply
515         #
516         #  Note that some attributes may not exist at some
517         #  stages.  e.g. There may be no proxy-reply
518         #  attributes if this module is used in the
519         #  'authorize' section.
520         #
521         input_pairs = request
522
523         #
524         #  Where to place the output attributes (if any) from
525         #  the executed program.  The values allowed, and the
526         #  restrictions as to availability, are the same as
527         #  for the input_pairs.
528         #
529         output_pairs = reply
530
531         #
532         #  When to execute the program.  If the packet
533         #  type does NOT match what's listed here, then
534         #  the module does NOT execute the program.
535         #
536         #  For a list of allowed packet types, see
537         #  the 'dictionary' file, and look for VALUEs
538         #  of the Packet-Type attribute.
539         #
540         #  By default, the module executes on ANY packet.
541         #  Un-comment out the following line to tell the
542         #  module to execute only if an Access-Accept is
543         #  being sent to the NAS.
544         #
545         #packet_type = Access-Accept
546
547         #
548         #  Should we escape the environment variables?
549         #  
550         #  If this is set, all the RADIUS attributes
551         #  are capitalised and dashes replaced with
552         #  underscores. Also, RADIUS values are surrounded
553         #  with double-quotes.
554         #
555         #  That is to say: User-Name=BobUser => USER_NAME="BobUser"
556         shell_escape = yes
557
558 }
559 # -*- text -*-
560 #
561 #  $Id$
562
563 #  "passwd" configuration, for the /etc/group file. Adds a Etc-Group-Name
564 #  attribute for every group that the user is member of.
565 #
566 #  You will have to define the Etc-Group-Name in the 'dictionary' file
567 #  as a 'string' type.
568 #
569 #  The Group-Name attribute is automatically created by the Unix module,
570 #  and does checking against /etc/group automatically.
571 #
572 #  i.e. this module should NOT be used as-is, but should be edited to
573 #  point to a different group file.
574 #
575 passwd etc_group {
576         filename = /etc/group
577         format = "=Etc-Group-Name:::*,User-Name"
578         hashsize = 50
579         ignorenislike = yes
580         allowmultiplekeys = yes
581         delimiter = ":"
582 }
583
584 # -*- text -*-
585 #
586 #  $Id$
587
588 #
589 #  Execute external programs
590 #
591 #  This module is useful only for 'xlat'.  To use it,
592 #  put 'exec' into the 'instantiate' section.  You can then
593 #  do dynamic translation of attributes like:
594 #
595 #  Attribute-Name = `%{exec:/path/to/program args}`
596 #
597 #  The value of the attribute will be replaced with the output
598 #  of the program which is executed.  Due to RADIUS protocol
599 #  limitations, any output over 253 bytes will be ignored.
600 #
601 #  The RADIUS attributes from the user request will be placed
602 #  into environment variables of the executed program, as
603 #  described in "man unlang" and in doc/variables.txt
604 #
605 #  See also "echo" for more sample configuration.
606 #
607 exec {
608         wait = no
609         input_pairs = request
610         shell_escape = yes
611         output = none
612 }
613 # -*- text -*-
614 #
615 #  $Id$
616
617 #
618 # The expiration module. This handles the Expiration attribute
619 # It should be included in the *end* of the authorize section
620 # in order to handle user Expiration. It should also be included
621 # in the instantiate section in order to register the Expiration
622 # compare function
623 #
624 expiration {
625         #
626         # The Reply-Message which will be sent back in case the
627         # account has expired. Dynamic substitution is supported
628         #
629         reply-message = "Password Has Expired\r\n" 
630         #reply-message = "Your account has expired, %{User-Name}\r\n"
631 }
632 # -*- text -*-
633 #
634 #  $Id$
635
636 #
637 #  The 'expression' module currently has no configuration.
638 #
639 #  This module is useful only for 'xlat'.  To use it,
640 #  put 'expr' into the 'instantiate' section.  You can then
641 #  do dynamic translation of attributes like:
642 #
643 #  Attribute-Name = `%{expr:2 + 3 + %{exec: uid -u}}`
644 #
645 #  The value of the attribute will be replaced with the output
646 #  of the program which is executed.  Due to RADIUS protocol
647 #  limitations, any output over 253 bytes will be ignored.
648 #
649 #  The module also registers a few paircompare functions
650 expr {
651 }
652 # -*- text -*-
653 #
654 #  $Id$
655
656 # Livingston-style 'users' file
657 #
658 files {
659         # The default key attribute to use for matches.  The content
660         # of this attribute is used to match the "name" of the
661         # entry.
662         #key = "%{Stripped-User-Name:-%{User-Name}}"
663
664         usersfile = ${confdir}/users
665         acctusersfile = ${confdir}/acct_users
666         preproxy_usersfile = ${confdir}/preproxy_users
667
668         #  If you want to use the old Cistron 'users' file
669         #  with FreeRADIUS, you should change the next line
670         #  to 'compat = cistron'.  You can the copy your 'users'
671         #  file from Cistron.
672         compat = no
673 }
674 # -*- text -*-
675 #
676 #  $Id$
677
678 #  Do server side ip pool management. Should be added in
679 #  post-auth and accounting sections.
680 #
681 #  The module also requires the existance of the Pool-Name
682 #  attribute. That way the administrator can add the Pool-Name
683 #  attribute in the user profiles and use different pools for
684 #  different users. The Pool-Name attribute is a *check* item
685 #  not a reply item.
686 #
687 #  The Pool-Name should be set to the ippool module instance
688 #  name or to DEFAULT to match any module.
689
690 #
691 # Example:
692 # radiusd.conf: ippool students { [...] }
693 #               ippool teachers { [...] }
694 # users file  : DEFAULT Group == students, Pool-Name := "students"
695 #               DEFAULT Group == teachers, Pool-Name := "teachers"
696 #               DEFAULT Group == other, Pool-Name := "DEFAULT"
697 #
698 # ********* IF YOU CHANGE THE RANGE PARAMETERS YOU MUST *********
699 # ********* THEN ERASE THE DB FILES                     *********
700 #
701 ippool main_pool {
702
703         #  range-start,range-stop:
704         #       The start and end ip addresses for this pool.
705         range-start = 192.168.1.1
706         range-stop = 192.168.3.254
707
708         #  netmask:
709         #       The network mask used for this pool.
710         netmask = 255.255.255.0
711
712         #  cache-size:
713         #       The gdbm cache size for the db files. Should
714         #       be equal to the number of ip's available in
715         #       the ip pool
716         cache-size = 800
717
718         # session-db:
719         #       The main db file used to allocate addresses.
720         session-db = ${db_dir}/db.ippool
721
722         # ip-index:
723         #       Helper db index file used in multilink
724         ip-index = ${db_dir}/db.ipindex
725
726         # override:
727         #       If set, the Framed-IP-Address already in the
728         #       reply (if any) will be discarded, and replaced
729         #       with a Framed-IP-Address assigned here.
730         override = no
731
732         # maximum-timeout:
733         #       Specifies the maximum time in seconds that an
734         #       entry may be active.  If set to zero, means
735         #       "no timeout".  The default value is 0
736         maximum-timeout = 0
737
738         # key:
739         #       The key to use for the session database (which
740         #       holds the allocated ip's) normally it should
741         #       just be the nas ip/port (which is the default).
742         #
743         #       If your NAS sends the same value of NAS-Port
744         #       all requests, the key should be based on some
745         #       other attribute that is in ALL requests, AND
746         #       is unique to each machine needing an IP address.
747         #key = "%{NAS-IP-Address} %{NAS-Port}"
748 }
749 # -*- text -*-
750 #
751 #  $Id$
752
753 #
754 #  Kerberos.  See doc/rlm_krb5 for minimal docs.
755 #
756 krb5 {
757         keytab = /path/to/keytab
758         service_principal = name_of_principle
759 }
760 # -*- text -*-
761 #
762 #  $Id$
763
764 # Lightweight Directory Access Protocol (LDAP)
765 #
766 #  This module definition allows you to use LDAP for
767 #  authorization and authentication.
768 #
769 #  See raddb/sites-available/default for reference to the
770 #  ldap module in the authorize and authenticate sections.
771 #
772 #  However, LDAP can be used for authentication ONLY when the
773 #  Access-Request packet contains a clear-text User-Password
774 #  attribute.  LDAP authentication will NOT work for any other
775 #  authentication method.
776 #
777 #  This means that LDAP servers don't understand EAP.  If you
778 #  force "Auth-Type = LDAP", and then send the server a
779 #  request containing EAP authentication, then authentication
780 #  WILL NOT WORK.
781 #
782 #  The solution is to use the default configuration, which does
783 #  work.
784 #
785 #  Setting "Auth-Type = LDAP" is ALMOST ALWAYS WRONG.  We
786 #  really can't emphasize this enough.
787 #       
788 ldap {
789         #
790         #  Note that this needs to match the name in the LDAP
791         #  server certificate, if you're using ldaps.
792         server = "ldap.your.domain"
793         #identity = "cn=admin,o=My Org,c=UA"
794         #password = mypass
795         basedn = "o=My Org,c=UA"
796         filter = "(uid=%{Stripped-User-Name:-%{User-Name}})"
797         #base_filter = "(objectclass=radiusprofile)"
798
799         #  How many connections to keep open to the LDAP server.
800         #  This saves time over opening a new LDAP socket for
801         #  every authentication request.
802         ldap_connections_number = 5
803
804         # seconds to wait for LDAP query to finish. default: 20
805         timeout = 4
806
807         #  seconds LDAP server has to process the query (server-side
808         #  time limit). default: 20
809         #
810         #  LDAP_OPT_TIMELIMIT is set to this value.
811         timelimit = 3
812
813         #
814         #  seconds to wait for response of the server. (network
815         #   failures) default: 10
816         #
817         #  LDAP_OPT_NETWORK_TIMEOUT is set to this value.
818         net_timeout = 1
819
820         #
821         #  This subsection configures the tls related items
822         #  that control how FreeRADIUS connects to an LDAP
823         #  server.  It contains all of the "tls_*" configuration
824         #  entries used in older versions of FreeRADIUS.  Those
825         #  configuration entries can still be used, but we recommend
826         #  using these.
827         #
828         tls {
829                 # Set this to 'yes' to use TLS encrypted connections
830                 # to the LDAP database by using the StartTLS extended
831                 # operation.
832                 #                       
833                 # The StartTLS operation is supposed to be
834                 # used with normal ldap connections instead of
835                 # using ldaps (port 689) connections
836                 start_tls = no
837
838                 # cacertfile    = /path/to/cacert.pem
839                 # cacertdir             = /path/to/ca/dir/
840                 # certfile              = /path/to/radius.crt
841                 # keyfile               = /path/to/radius.key
842                 # randfile              = /path/to/rnd
843
844                 #  Certificate Verification requirements.  Can be:
845                 #    "never" (don't even bother trying)
846                 #    "allow" (try, but don't fail if the cerificate
847                 #               can't be verified)
848                 #    "demand" (fail if the certificate doesn't verify.)
849                 #
850                 #       The default is "allow"
851                 # require_cert  = "demand"
852         }
853
854         # default_profile = "cn=radprofile,ou=dialup,o=My Org,c=UA"
855         # profile_attribute = "radiusProfileDn"
856         # access_attr = "dialupAccess"
857
858         # Mapping of RADIUS dictionary attributes to LDAP
859         # directory attributes.
860         dictionary_mapping = ${confdir}/ldap.attrmap
861
862         #  Set password_attribute = nspmPassword to get the
863         #  user's password from a Novell eDirectory
864         #  backend. This will work ONLY IF FreeRADIUS has been
865         #  built with the --with-edir configure option.
866         #
867         #  See also the following links:
868         #
869         #  http://www.novell.com/coolsolutions/appnote/16745.html
870         #  https://secure-support.novell.com/KanisaPlatform/Publishing/558/3009668_f.SAL_Public.html
871         #
872         #  Novell may require TLS encrypted sessions before returning
873         #  the user's password.
874         #
875         # password_attribute = userPassword
876
877         #  Un-comment the following to disable Novell
878         #  eDirectory account policy check and intruder
879         #  detection. This will work *only if* FreeRADIUS is
880         #  configured to build with --with-edir option.
881         #
882         edir_account_policy_check = no
883
884         #
885         #  Group membership checking.  Disabled by default.
886         #
887         # groupname_attribute = cn
888         # groupmembership_filter = "(|(&(objectClass=GroupOfNames)(member=%{Ldap-UserDn}))(&(objectClass=GroupOfUniqueNames)(uniquemember=%{Ldap-UserDn})))"
889         # groupmembership_attribute = radiusGroupName
890
891         # compare_check_items = yes
892         # do_xlat = yes
893         # access_attr_used_for_allow = yes
894
895         #
896         #  By default, if the packet contains a User-Password,
897         #  and no other module is configured to handle the
898         #  authentication, the LDAP module sets itself to do
899         #  LDAP bind for authentication.
900         #
901         #  THIS WILL ONLY WORK FOR PAP AUTHENTICATION.
902         #
903         #  THIS WILL NOT WORK FOR CHAP, MS-CHAP, or 802.1x (EAP). 
904         #
905         #  You can disable this behavior by setting the following
906         #  configuration entry to "no".
907         #
908         #  allowed values: {no, yes}
909         # set_auth_type = yes
910
911         #  ldap_debug: debug flag for LDAP SDK
912         #  (see OpenLDAP documentation).  Set this to enable
913         #  huge amounts of LDAP debugging on the screen.
914         #  You should only use this if you are an LDAP expert.
915         #
916         #       default: 0x0000 (no debugging messages)
917         #       Example:(LDAP_DEBUG_FILTER+LDAP_DEBUG_CONNS)
918         #ldap_debug = 0x0028 
919 }
920 # -*- text -*-
921 #
922 #  $Id$
923
924 # The logintime module. This handles the Login-Time,
925 # Current-Time, and Time-Of-Day attributes.  It should be
926 # included in the *end* of the authorize section in order to
927 # handle Login-Time checks. It should also be included in the
928 # instantiate section in order to register the Current-Time
929 # and Time-Of-Day comparison functions.
930 #
931 # When the Login-Time attribute is set to some value, and the
932 # user has bene permitted to log in, a Session-Timeout is
933 # calculated based on the remaining time.  See "doc/README".
934 #
935 logintime {
936         #
937         # The Reply-Message which will be sent back in case
938         # the account is calling outside of the allowed
939         # timespan. Dynamic substitution is supported.
940         #
941         reply-message = "You are calling outside your allowed timespan\r\n"
942         #reply-message = "Outside allowed timespan (%{control:Login-Time}), %{User-Name}\r\n"
943
944         # The minimum timeout (in seconds) a user is allowed
945         # to have. If the calculated timeout is lower we don't
946         # allow the logon. Some NASes do not handle values
947         # lower than 60 seconds well.
948         minimum-timeout = 60
949 }
950
951 # -*- text -*-
952 #
953 #  $Id$
954
955 ######################################################################
956 #
957 #  This next section is a sample configuration for the "passwd"
958 #  module, that reads flat-text files.
959 #
960 #  The file is in the format <mac>,<ip>
961 #
962 #       00:01:02:03:04:05,192.168.1.100
963 #       01:01:02:03:04:05,192.168.1.101
964 #       02:01:02:03:04:05,192.168.1.102
965 #
966 #  This lets you perform simple static IP assignments from a flat-text
967 #  file.  You will have to define lease times yourself.
968 #
969 ######################################################################
970
971 passwd mac2ip {
972         filename = ${confdir}/mac2ip
973         format = "*DHCP-Client-Hardware-Address:=DHCP-Your-IP-Address"
974         delimiter = ","
975 }
976 # -*- text -*-
977 #
978 #  $Id$
979
980 #  A simple file to map a MAC address to a VLAN.
981 #
982 #  The file should be in the format MAC,VLAN
983 #  the VLAN name cannot have spaces in it, for example:
984 #
985 #       00:01:02:03:04:05,VLAN1
986 #       03:04:05:06:07:08,VLAN2
987 #       ...
988 #
989 passwd mac2vlan {
990         filename = ${confdir}/mac2vlan
991         format = "*VMPS-Mac:=VMPS-VLAN-Name"
992         delimiter = ","
993 }
994 # -*- text -*-
995 #
996 #  $Id$
997
998 # Microsoft CHAP authentication
999 #
1000 #  This module supports MS-CHAP and MS-CHAPv2 authentication.
1001 #  It also enforces the SMB-Account-Ctrl attribute.
1002 #
1003 mschap {
1004         #
1005         #  If you are using /etc/smbpasswd, see the 'passwd'
1006         #  module for an example of how to use /etc/smbpasswd
1007
1008         # if use_mppe is not set to no mschap will
1009         # add MS-CHAP-MPPE-Keys for MS-CHAPv1 and
1010         # MS-MPPE-Recv-Key/MS-MPPE-Send-Key for MS-CHAPv2
1011         #
1012         #use_mppe = no
1013
1014         # if mppe is enabled require_encryption makes
1015         # encryption moderate
1016         #
1017         #require_encryption = yes
1018
1019         # require_strong always requires 128 bit key
1020         # encryption
1021         #
1022         #require_strong = yes
1023
1024         # Windows sends us a username in the form of
1025         # DOMAIN\user, but sends the challenge response
1026         # based on only the user portion.  This hack
1027         # corrects for that incorrect behavior.
1028         #
1029         #with_ntdomain_hack = no
1030
1031         # The module can perform authentication itself, OR
1032         # use a Windows Domain Controller.  This configuration
1033         # directive tells the module to call the ntlm_auth
1034         # program, which will do the authentication, and return
1035         # the NT-Key.  Note that you MUST have "winbindd" and
1036         # "nmbd" running on the local machine for ntlm_auth
1037         # to work.  See the ntlm_auth program documentation
1038         # for details.
1039         #
1040         # If ntlm_auth is configured below, then the mschap
1041         # module will call ntlm_auth for every MS-CHAP
1042         # authentication request.  If there is a cleartext
1043         # or NT hashed password available, you can set
1044         # "MS-CHAP-Use-NTLM-Auth := No" in the control items,
1045         # and the mschap module will do the authentication itself,
1046         # without calling ntlm_auth.
1047         #
1048         # Be VERY careful when editing the following line!
1049         #
1050         # You can also try setting the user name as:
1051         #
1052         #       ... --username=%{mschap:User-Name} ...
1053         #
1054         # In that case, the mschap module will look at the User-Name
1055         # attribute, and do prefix/suffix checks in order to obtain
1056         # the "best" user name for the request.
1057         #
1058         #ntlm_auth = "/path/to/ntlm_auth --request-nt-key --username=%{Stripped-User-Name:-%{User-Name:-None}} --challenge=%{mschap:Challenge:-00} --nt-response=%{mschap:NT-Response:-00}"
1059 }
1060 # -*- text -*-
1061 #
1062 #  $Id$
1063
1064
1065 # Pluggable Authentication Modules
1066 #
1067 #  For Linux, see:
1068 #       http://www.kernel.org/pub/linux/libs/pam/index.html
1069 #
1070 #  WARNING: On many systems, the system PAM libraries have
1071 #           memory leaks!  We STRONGLY SUGGEST that you do not
1072 #           use PAM for authentication, due to those memory leaks.
1073 #
1074 pam {
1075         #
1076         #  The name to use for PAM authentication.
1077         #  PAM looks in /etc/pam.d/${pam_auth_name}
1078         #  for it's configuration.  See 'redhat/radiusd-pam'
1079         #  for a sample PAM configuration file.
1080         #
1081         #  Note that any Pam-Auth attribute set in the 'authorize'
1082         #  section will over-ride this one.
1083         #
1084         pam_auth = radiusd
1085 }
1086 # -*- text -*-
1087 #
1088 #  $Id$
1089
1090 # PAP module to authenticate users based on their stored password
1091 #
1092 #  Supports multiple encryption/hash schemes.  See "man rlm_pap"
1093 #  for details.
1094 #
1095 #  The "auto_header" configuration item can be set to "yes".
1096 #  In this case, the module will look inside of the User-Password
1097 #  attribute for the headers {crypt}, {clear}, etc., and will
1098 #  automatically create the attribute on the right-hand side,
1099 #  with the correct value.  It will also automatically handle
1100 #  Base-64 encoded data, hex strings, and binary data.
1101 pap {
1102         auto_header = no
1103 }
1104 # -*- text -*-
1105 #
1106 #  $Id$
1107
1108 # passwd module allows to do authorization via any passwd-like
1109 # file and to extract any attributes from these modules
1110 #
1111 # parameters are:
1112 #   filename - path to filename
1113 #   format - format for filename record. This parameters
1114 #            correlates record in the passwd file and RADIUS
1115 #            attributes.
1116 #
1117 #            Field marked as '*' is key field. That is, the parameter
1118 #            with this name from the request is used to search for
1119 #            the record from passwd file
1120 #            Attribute marked as '=' is added to reply_itmes instead
1121 #            of default configure_itmes
1122 #            Attribute marked as '~' is added to request_items
1123 #
1124 #            Field marked as ',' may contain a comma separated list
1125 #            of attributes.
1126 #   hashsize - hashtable size. If 0 or not specified records are not
1127 #            stored in memory and file is red on every request.
1128 #   allowmultiplekeys - if few records for every key are allowed
1129 #   ignorenislike - ignore NIS-related records
1130 #   delimiter - symbol to use as a field separator in passwd file,
1131 #            for format ':' symbol is always used. '\0', '\n' are
1132 #            not allowed 
1133 #
1134
1135 # -*- text -*-
1136 #
1137 #  $Id$
1138
1139 #
1140 #  Module implementing a DIFFERENT policy language.
1141 #  The syntax here is NOT "unlang", but something else.
1142 #
1143 #  See the "raddb/policy.txt" file for documentation and examples.
1144 #  There isn't much else in the way of documentation, sorry.
1145 #
1146 policy {
1147        #  The only configuration item is a filename containing
1148        #  the policies to execute.
1149        #
1150        #  When "policy" is listed in a section (e.g. "authorize"),
1151        #  it will run a policy named for that section.
1152        # 
1153        filename = ${confdir}/policy.txt
1154 }
1155
1156 # -*- text -*-
1157 #
1158 #  $Id$
1159
1160 # Preprocess the incoming RADIUS request, before handing it off
1161 # to other modules.
1162 #
1163 #  This module processes the 'huntgroups' and 'hints' files.
1164 #  In addition, it re-writes some weird attributes created
1165 #  by some NASes, and converts the attributes into a form which
1166 #  is a little more standard.
1167 #
1168 preprocess {
1169         huntgroups = ${confdir}/huntgroups
1170         hints = ${confdir}/hints
1171
1172         # This hack changes Ascend's wierd port numberings
1173         # to standard 0-??? port numbers so that the "+" works
1174         # for IP address assignments.
1175         with_ascend_hack = no
1176         ascend_channels_per_line = 23
1177
1178         # Windows NT machines often authenticate themselves as
1179         # NT_DOMAIN\username
1180         #
1181         # If this is set to 'yes', then the NT_DOMAIN portion
1182         # of the user-name is silently discarded.
1183         #
1184         # This configuration entry SHOULD NOT be used.
1185         # See the "realms" module for a better way to handle
1186         # NT domains.
1187         with_ntdomain_hack = no
1188
1189         # Specialix Jetstream 8500 24 port access server.
1190         #
1191         # If the user name is 10 characters or longer, a "/"
1192         # and the excess characters after the 10th are
1193         # appended to the user name.
1194         #
1195         # If you're not running that NAS, you don't need
1196         # this hack.
1197         with_specialix_jetstream_hack = no
1198
1199         # Cisco (and Quintum in Cisco mode) sends it's VSA attributes
1200         # with the attribute name *again* in the string, like:
1201         #
1202         #   H323-Attribute = "h323-attribute=value".
1203         #
1204         # If this configuration item is set to 'yes', then
1205         # the redundant data in the the attribute text is stripped
1206         # out.  The result is:
1207         #
1208         #  H323-Attribute = "value"
1209         #
1210         # If you're not running a Cisco or Quintum NAS, you don't
1211         # need this hack.
1212         with_cisco_vsa_hack = no
1213 }
1214 # -*- text -*-
1215 #
1216 #  $Id$
1217
1218 #  Write a 'utmp' style file, of which users are currently
1219 #  logged in, and where they've logged in from.
1220 #
1221 #  This file is used mainly for Simultaneous-Use checking,
1222 #  and also 'radwho', to see who's currently logged in.
1223 #
1224 radutmp {
1225         #  Where the file is stored.  It's not a log file,
1226         #  so it doesn't need rotating.
1227         #
1228         filename = ${logdir}/radutmp
1229
1230         #  The field in the packet to key on for the
1231         #  'user' name,  If you have other fields which you want
1232         #  to use to key on to control Simultaneous-Use,
1233         #  then you can use them here.
1234         #
1235         #  Note, however, that the size of the field in the
1236         #  'utmp' data structure is small, around 32
1237         #  characters, so that will limit the possible choices
1238         #  of keys.
1239         #
1240         #  You may want instead: %{Stripped-User-Name:-%{User-Name}}
1241         username = %{User-Name}
1242
1243
1244         #  Whether or not we want to treat "user" the same
1245         #  as "USER", or "User".  Some systems have problems
1246         #  with case sensitivity, so this should be set to
1247         #  'no' to enable the comparisons of the key attribute
1248         #  to be case insensitive.
1249         #
1250         case_sensitive = yes
1251
1252         #  Accounting information may be lost, so the user MAY
1253         #  have logged off of the NAS, but we haven't noticed.
1254         #  If so, we can verify this information with the NAS,
1255         #
1256         #  If we want to believe the 'utmp' file, then this
1257         #  configuration entry can be set to 'no'.
1258         #
1259         check_with_nas = yes            
1260
1261         # Set the file permissions, as the contents of this file
1262         # are usually private.
1263         perm = 0600
1264
1265         callerid = "yes"
1266 }
1267 # -*- text -*-
1268 #
1269 #  $Id$
1270
1271 # Realm module, for proxying.
1272 #
1273 #  You can have multiple instances of the realm module to
1274 #  support multiple realm syntaxs at the same time.  The
1275 #  search order is defined by the order that the modules are listed
1276 #  in the authorize and preacct sections.
1277 #
1278 #  Four config options:
1279 #       format         -  must be "prefix" or "suffix"
1280 #                         The special cases of "DEFAULT"
1281 #                         and "NULL" are allowed, too.
1282 #       delimiter      -  must be a single character
1283
1284 #  'realm/username'
1285 #
1286 #  Using this entry, IPASS users have their realm set to "IPASS".
1287 realm IPASS {
1288         format = prefix
1289         delimiter = "/"
1290 }
1291
1292 #  'username@realm'
1293 #
1294 realm suffix {
1295         format = suffix
1296         delimiter = "@"
1297 }
1298
1299 #  'username%realm'
1300 #
1301 realm realmpercent {
1302         format = suffix
1303         delimiter = "%"
1304 }
1305
1306 #
1307 #  'domain\user'
1308 #
1309 realm ntdomain {
1310         format = prefix
1311         delimiter = "\\"
1312 }       
1313 # -*- text -*-
1314 #
1315 #  $Id$
1316
1317 #  An example configuration for using /etc/smbpasswd.
1318 #
1319 #  See the "passwd" file for documentation on the configuration items
1320 #  for this module.
1321 #
1322 passwd smbpasswd {
1323         filename = /etc/smbpasswd
1324         format = "*User-Name::LM-Password:NT-Password:SMB-Account-CTRL-TEXT::"
1325         hashsize = 100
1326         ignorenislike = no
1327         allowmultiplekeys = no
1328 }
1329 # -*- text -*-
1330 #
1331 #  $Id$
1332
1333 #
1334 #  The rlm_sql_log module appends the SQL queries in a log
1335 #  file which is read later by the radsqlrelay program.
1336 #
1337 #  This module only performs the dynamic expansion of the
1338 #  variables found in the SQL statements. No operation is
1339 #  executed on the database server. (this could be done
1340 #  later by an external program) That means the module is
1341 #  useful only with non-"SELECT" statements.
1342 #
1343 #  See rlm_sql_log(5) manpage.
1344 #
1345 #  This same functionality could also be implemented by logging
1346 #  to a "detail" file, reading that, and then writing to SQL.
1347 #  See raddb/sites-available/buffered-sql for an example.
1348 #
1349 sql_log {
1350         path = "${radacctdir}/sql-relay"
1351         acct_table = "radacct"
1352         postauth_table = "radpostauth"
1353         sql_user_name = "%{%{User-Name}:-DEFAULT}"
1354
1355         Start = "INSERT INTO ${acct_table} (AcctSessionId, UserName, \
1356          NASIPAddress, FramedIPAddress, AcctStartTime, AcctStopTime, \
1357          AcctSessionTime, AcctTerminateCause) VALUES                 \
1358          ('%{Acct-Session-Id}', '%{User-Name}', '%{NAS-IP-Address}', \
1359          '%{Framed-IP-Address}', '%S', '0', '0', '');"
1360         Stop = "INSERT INTO ${acct_table} (AcctSessionId, UserName,  \
1361          NASIPAddress, FramedIPAddress, AcctStartTime, AcctStopTime, \
1362          AcctSessionTime, AcctTerminateCause) VALUES                 \
1363          ('%{Acct-Session-Id}', '%{User-Name}', '%{NAS-IP-Address}', \
1364          '%{Framed-IP-Address}', '0', '%S', '%{Acct-Session-Time}',  \
1365          '%{Acct-Terminate-Cause}');"
1366         Alive = "INSERT INTO ${acct_table} (AcctSessionId, UserName, \
1367          NASIPAddress, FramedIPAddress, AcctStartTime, AcctStopTime, \
1368          AcctSessionTime, AcctTerminateCause) VALUES                 \
1369          ('%{Acct-Session-Id}', '%{User-Name}', '%{NAS-IP-Address}', \
1370          '%{Framed-IP-Address}', '0', '0', '%{Acct-Session-Time}','');"
1371
1372         Post-Auth = "INSERT INTO ${postauth_table}                   \
1373          (username, pass, reply, authdate) VALUES                    \
1374          ('%{User-Name}', '%{User-Password:-Chap-Password}',         \
1375          '%{reply:Packet-Type}', '%S');"
1376 }
1377
1378 # -*- text -*-
1379 #
1380 #  $Id$
1381
1382 # "Safe" radutmp - does not contain caller ID, so it can be
1383 # world-readable, and radwho can work for normal users, without
1384 # exposing any information that isn't already exposed by who(1).
1385 #
1386 # This is another 'instance' of the radutmp module, but it is given
1387 # then name "sradutmp" to identify it later in the "accounting"
1388 # section.
1389 radutmp sradutmp {
1390         filename = ${logdir}/sradutmp
1391         perm = 0644
1392         callerid = "no"
1393 }
1394 # -*- text -*-
1395 #
1396 #  $Id$
1397
1398 # Unix /etc/passwd style authentication
1399 #
1400 unix {
1401         #  As of 1.1.0, the Unix module no longer reads,
1402         #  or caches /etc/passwd, /etc/shadow, or /etc/group.
1403         #  If you wish to cache those files, see the passwd
1404         #  module.
1405         #
1406
1407         #
1408         #  The location of the "wtmp" file.
1409         #  The only use for 'radlast'.  If you don't use
1410         #  'radlast', then you can comment out this item.
1411         #
1412         #  Note that the radwtmp file may get large!  You should
1413         #  rotate it (cp /dev/null radwtmp), or just not use it.
1414         #
1415         radwtmp = ${logdir}/radwtmp
1416 }