Add a new configuration directive, new_attribute. If it is set then searchfor
[freeradius.git] / raddb / radiusd.conf.in
1 ##
2 ## radiusd.conf -- FreeRADIUS server configuration file.
3 ##
4 ##      http://www.freeradius.org/
5 ##      $Id$
6 ##
7
8 #       The location of other config files and
9 #       logfiles are declared in this file
10 #
11 #       Also general configuration for modules can be done
12 #       in this file, it is exported through the API to
13 #       modules that ask for it.
14 #
15 #       The configuration variables defined here are of the form ${foo}
16 #       They are local to this file, and do not change from request to
17 #       request.
18 #
19 #       The per-request variables are of the form %{Attribute-Name}, and
20 #       are taken from the values of the attribute in the incoming
21 #       request.  See 'doc/variables.txt' for more information.
22
23 prefix = @prefix@
24 exec_prefix = @exec_prefix@
25 sysconfdir = @sysconfdir@
26 localstatedir = @localstatedir@
27 sbindir = @sbindir@
28 logdir = @logdir@
29 raddbdir = @raddbdir@
30 radacctdir = @radacctdir@
31
32 #  Location of config and logfiles.
33 confdir = ${raddbdir}
34 run_dir = ${localstatedir}/run/radiusd
35
36 #
37 # libdir: Where to find the rlm_* modules.
38 #
39 #   This should be automatically set at configuration time.
40 #
41 #   If the server builds and installs, but fails at execution time
42 #   with an 'undefined symbol' error, then you can use the libdir
43 #   directive to work around the problem.
44 #
45 #   The cause is usually that a library has been installed on your
46 #   system in a place where the dynamic linker CANNOT find it.  When
47 #   executing as root (or another user), your personal environment MAY
48 #   be set up to allow the dynamic linker to find the library.  When
49 #   executing as a daemon, FreeRADIUS MAY NOT have the same
50 #   personalized configuration.
51 #
52 #   To work around the problem, find out which library contains that symbol,
53 #   and add the directory containing that library to the end of 'libdir',
54 #   with a colon separating the directory names.  NO spaces are allowed.
55 #
56 #   e.g. libdir = /usr/local/lib:/opt/package/lib
57 #
58 #   You can also try setting the LD_LIBRARY_PATH environment variable
59 #   in a script which starts the server.
60 #
61 #   If that does not work, then you can re-configure and re-build the
62 #   server to NOT use shared libraries, via:
63 #
64 #       ./configure --disable-shared
65 #       make
66 #       make install
67 #
68 libdir = @libdir@
69
70 #  pidfile: Where to place the PID of the RADIUS server.
71 #
72 #  The server may be signalled while it's running by using this
73 #  file.
74 #
75 #  This file is written when ONLY running in daemon mode.
76 #
77 #  e.g.:  kill -HUP `cat /var/run/radiusd/radiusd.pid`
78 #
79 pidfile = ${run_dir}/radiusd.pid
80
81
82 # user/group: The name (or #number) of the user/group to run radiusd as.
83 #
84 #   If these are commented out, the server will run as the user/group
85 #   that started it.  In order to change to a different user/group, you
86 #   WILL need to be root ( or have root privleges ) to start the server.
87 #
88 #   We STRONGLY recommend that you run the server with as few permissions
89 #   as possible.  That is, if you're not using shadow passwords, the
90 #   user and group items below should be set to 'nobody'.
91 #
92 #    On SCO (ODT 3) use "user = nouser" and "group = nogroup".
93 #
94 #  NOTE that some kernels refuse to setgid(group) when the value of
95 #  (unsigned)group is above 60000; don't use group nobody on these systems!
96 #
97 #  On systems with shadow passwords, you might have to set 'group = shadow'
98 #  for the server to be able to read the shadow password file.  If you can
99 #  authenticate users while in debug mode, but not in daemon mode, it may be
100 #  that the debugging mode server is running as a user that can read the
101 #  shadow info, and the user listed below can not.
102 #
103 #user = nobody
104 #group = nobody
105
106 #  max_request_time: The maximum time (in seconds) to handle a request.
107 #
108 #  Requests which take more time than this to process may be killed, and
109 #  a REJECT message is returned.
110 #
111 #  WARNING: If you notice that requests take a long time to be handled,
112 #  then this MAY INDICATE a bug in the server, in one of the modules
113 #  used to handle a request, OR in your local configuration.
114 #
115 #  This problem is most often seen when using an SQL database.  If it takes
116 #  more than a second or two to receive an answer from the SQL database,
117 #  then it probably means that you haven't indexed the database.  See your
118 #  SQL server documentation for more information.
119 #
120 #  Useful range of values: 5 to 120
121 #
122 max_request_time = 30
123
124 #  delete_blocked_requests: If the request takes MORE THAN 'max_request_time'
125 #  to be handled, then maybe the server should delete it.
126 #
127 #  If you're running in threaded, or thread pool mode, this setting
128 #  should probably be 'no'.  Setting it to 'yes' when using a threaded
129 #  server MAY cause the server to crash!
130 #
131 delete_blocked_requests = no
132
133 #  cleanup_delay: The time to wait (in seconds) before cleaning up
134 #  a reply which was sent to the NAS.
135 #
136 #  The RADIUS request is normally cached internally for a short period
137 #  of time, after the reply is sent to the NAS.  The reply packet may be
138 #  lost in the network, and the NAS will not see it.  The NAS will then
139 #  re-send the request, and the server will respond quickly with the
140 #  cached reply.
141 #
142 #  If this value is set too low, then duplicate requests from the NAS
143 #  MAY NOT be detected, and will instead be handled as seperate requests.
144 #
145 #  If this value is set too high, then the server will cache too many
146 #  requests, and some new requests may get blocked.  (See 'max_requests'.)
147 #
148 #  Useful range of values: 2 to 10
149 #
150 cleanup_delay = 5
151
152 #  max_requests: The maximum number of requests which the server keeps
153 #  track of.  This should be 256 multiplied by the number of clients.
154 #  e.g. With 4 clients, this number should be 1024.
155 #
156 #  If this number is too low, then when the server becomes busy,
157 #  it will not respond to any new requests, until the 'cleanup_delay'
158 #  time has passed, and it has removed the old requests.
159 #
160 #  If this number is set too high, then the server will use a bit more
161 #  memory for no real benefit.
162 #
163 #  If you aren't sure what it should be set to, it's better to set it
164 #  too high than too low.  Setting it to 1000 per client is probably
165 #  the highest it should be.
166 #
167 #  Useful range of values: 256 to infinity
168 #
169 max_requests = 1024
170
171 #  bind_address:  Make the server listen on a particular IP address, and
172 #  send replies out from that address.  This directive is most useful
173 #  for machines with multiple IP addresses on one interface.
174 #
175 #  It can either contain "*", or an IP address, or a fully qualified
176 #  Internet domain name.  The default is "*"
177 #
178 bind_address = *
179
180 #  port: Allows you to bind FreeRADIUS to a specific port.
181 #
182 #  The default port that most NAS boxes use is 1645, which is historical.
183 #  RFC 2138 defines 1812 to be the new port.  Many new servers and
184 #  NAS boxes use 1812, which can create interoperability problems.
185 #
186 #  The port is defined here to be 0 so that the server will pick up
187 #  the machine's local configuration for the radius port, as defined
188 #  in /etc/services.
189 #
190 #  If you want to use the default RADIUS port as defined on your server,
191 #  (usually through 'grep radius /etc/services') set this to 0 (zero).
192 #
193 #  A port given on the command-line via '-p' over-rides this one.
194 #
195 port = 0
196
197 #  hostname_lookups: Log the names of clients or just their IP addresses
198 #  e.g., www.freeradius.org (on) or 206.47.27.232 (off).
199 #  The default is 'off' because it'd be overall better for the net if people
200 #  had to knowingly turn this feature on, since enabling it means that
201 #  each client request will result in AT LEAST one lookup request to the
202 #  nameserver.
203 #
204 #  Turning hostname lookups off also means that the server won't block
205 #  for 30 seconds, if it sees an IP address which has no name associated
206 #  with it.
207 #
208 #  allowed values: {no, yes}
209 #
210 hostname_lookups = no
211
212 #  Core dumps are a bad thing.  This should only be set to 'yes'
213 #  if you're debugging a problem with the server.
214 #
215 #  allowed values: {no, yes}
216 #
217 allow_core_dumps = no
218
219 #  Regular expressions
220 #
221 #  These items are set at configure time.  If they're set to "yes",
222 #  then setting them to "no" turns off regular expression support.
223 #
224 #  If they're set to "no" at configure time, then setting them to "yes"
225 #  WILL NOT WORK.  It will give you an error.
226 #
227 regular_expressions     = @REGEX@
228 extended_expressions    = @REGEX_EXTENDED@
229
230 #  Log the full User-Name attribute, as it was found in the request.
231 #
232 # allowed values: {no, yes}
233 #
234 log_stripped_names = no
235
236 #  Log authentication requests to the log file.
237 #
238 #  allowed values: {no, yes}
239 #
240 log_auth = no
241
242 #  Log passwords with the authentication requests.
243 #  log_auth_badpass  - logs password if it's rejected
244 #  log_auth_goodpass - logs password if it's correct
245 #
246 #  allowed values: {no, yes}
247 #
248 log_auth_badpass = no
249 log_auth_goodpass = no
250
251 # usercollide:  Turn "username collision" code on and off.  See the
252 # "doc/duplicate-users" file
253 #
254 usercollide = no
255
256 # lower_user / lower_pass:  
257 # Lowercase the username/password "before" or "after"
258 # attempting to authenticate.  
259 #
260 # If "before", the server will first modify the request
261 # and then try to auth the user.  If "after", the server
262 # will first auth using the values provided by the
263 # user.  If that fails it will reprocess the request
264 # after modifying it as you specify below.
265
266 # This is as close as we can get to case insensitivity.  It is
267 # the admin's job to ensure that the username on the auth
268 # db side is *also* lowercase to make this work
269 #
270 # Default is 'no' (don't lowercase values)
271 # Valid values = "before" / "after" / "no"
272 #
273 lower_user = no
274 lower_pass = no
275
276 # nospace_user / nospace_pass:
277 # Some users like to enter spaces in their username or
278 # password incorrectly.  To save yourself the tech support
279 # call, you can eliminate those spaces here:
280 #
281 # Default is 'no' (don't remove spaces)
282 # Valid values = "before" / "after" / "no" (explanation above)
283 #
284 nospace_user = no
285 nospace_pass = no
286
287 #  Which program to execute check doing concurrency checks.
288 checkrad = ${sbindir}/checkrad
289
290 # SECURITY CONFIGURATION
291 #
292 #  There may be multiple methods of attacking on the server.  This
293 #  section holds the configuration items which minimize the impact
294 #  of those attacks
295 #
296 security {
297         #
298         #  max_attributes: The maximum number of attributes
299         #  permitted in a RADIUS packet.  Packets which have MORE
300         #  than this number of attributes in them will be dropped.
301         #
302         #  If this number is set too low, then no RADIUS packets
303         #  will be accepted.
304         #
305         #  If this number is set too high, then an attacker may be
306         #  able to send a small number of packets which will cause
307         #  the server to use all available memory on the machine.
308         #
309         #  Setting this number to 0 means "allow any number of attributes"
310         max_attributes = 200
311
312         #
313         #  delayed_reject: When sending an Access-Reject, it can be
314         #  delayed for a few seconds.  This may help slow down a DoS
315         #  attack.  It also helps to slow down people trying to brute-force
316         #  crack a users password.
317         #
318         #  Setting this number to 0 means "send rejects immediately"
319         #
320         #  If this number is set higher than 'cleanup_delay', then the
321         #  rejects will be sent at 'cleanup_delay' time, when the request
322         #  is deleted from the internal cache of requests.
323         #
324         #  Useful ranges: 1 to 5
325         reject_delay = 1
326 }
327
328 # PROXY CONFIGURATION
329 #
330 #  proxy_requests: Turns proxying of RADIUS requests on or off.
331 #
332 #  The server has proxying turned on by default.  If your system is NOT
333 #  set up to proxy requests to another server, then you can turn proxying
334 #  off here.  This will save a small amount of resources on the server.
335 #
336 #  If you have proxying turned off, and your configuration files say
337 #  to proxy a request, then an error message will be logged.
338 #
339 #  To disable proxying, change the "yes" to "no", and comment the
340 #  $INCLUDE line.
341 #
342 #  allowed values: {no, yes}
343 #
344 proxy_requests  = yes
345 $INCLUDE  ${confdir}/proxy.conf
346
347
348 # CLIENTS CONFIGURATION
349 #
350 #  Client configuration is defined in "clients.conf".  If you don't
351 #  use the "clients.conf", you can comment the following.  The use of
352 #  "clients.conf" is recommended over the old "clients", though both
353 #  are supported.
354 #
355 $INCLUDE  ${confdir}/clients.conf
356
357
358 # SNMP CONFIGURATION
359 #
360 #  Snmp configuration is only valid if you enabled SNMP support when
361 #  you compiled radiusd.
362 #
363 $INCLUDE  ${confdir}/snmp.conf
364
365
366 # THREAD POOL CONFIGURATION
367 #
368 #  The thread pool is a long-lived group of threads which
369 #  take turns (round-robin) handling any incoming requests.
370 #
371 #
372 #  You probably want to have a few spare threads around,
373 #  so that high-load situations can be handled immediately.  If you
374 #  don't have any spare threads, then the request handling will
375 #  be delayed while a new thread is created, and added to the pool.
376 #
377 #  You probably don't want too many spare threads around,
378 #  otherwise they'll be sitting there taking up resources, and
379 #  not doing anything productive.
380 #
381 #  The numbers given below should be adequate for most situations.
382 #
383 thread pool {
384         #  Number of servers to start initially --- should be a reasonable
385         #  ballpark figure.
386         start_servers = 5
387
388         #  Limit on the total number of servers running.
389         #
390         #  If this limit is ever reached, clients will be LOCKED OUT, so it
391         #  should NOT BE SET TOO LOW.  It is intended mainly as a brake to
392         #  keep a runaway server from taking the system with it as it spirals
393         #  down...
394         #
395         #  You may find that the server is regularly reaching the
396         #  'max_servers' number of threads, and that increasing
397         #  'max_servers' doesn't seem to make much difference.
398         #   If this is the case, then the problem is MOST LIKELY that
399         #   your back-end databases are taking too long to respond, and
400         #   are preventing the server from responding in a timely manner.
401         #   For more information, see 'max_request_time', above.
402         #
403         max_servers = 32
404
405         #  Server-pool size regulation.  Rather than making you guess
406         #  how many servers you need, FreeRADIUS dynamically adapts to
407         #  the load it sees, that is, it tries to maintain enough
408         #  servers to handle the current load, plus a few spare
409         #  servers to handle transient load spikes.
410         #
411         #  It does this by periodically checking how many servers are
412         #  waiting for a request.  If there are fewer than
413         #  min_spare_servers, it creates a new spare.  If there are
414         #  more than max_spare_servers, some of the spares die off.
415         #  The default values are probably OK for most sites.
416         #
417         min_spare_servers = 3
418         max_spare_servers = 10
419
420         #  There may be memory leaks or resource allocation problems with
421         #  the server.  If so, set this value to 300 or so, so that the
422         #  resources will be cleaned up periodically.
423         #
424         #  This should only be necessary if there are serious bugs in the
425         #  server which have not yet been fixed.
426         #
427         #  '0' is a special value meaning 'infinity', or 'the servers never
428         #  exit'
429         max_requests_per_server = 0
430 }
431
432 # MODULE CONFIGURATION
433 #
434 #  The names and configuration of each module is located in this section.
435 #
436 #  After the modules are defined here, they may be referred to by name,
437 #  in other sections of this configuration file.
438 #
439 modules {
440
441         # Pluggable Authentication Modules
442         #
443         #  For Linux, see:
444         #       http://www.kernel.org/pub/linux/libs/pam/index.html
445         #
446         pam {
447                 #
448                 #  The name to use for PAM authentication.
449                 #  PAM looks in /etc/pam.d/${pam_auth_name}
450                 #  for it's configuration.  See 'redhat/radiusd-pam'
451                 #  for a sample PAM configuration file.
452                 #
453                 #  Note that any Pam-Auth attribute set in the 'users'
454                 #  file over-rides this one.
455                 #
456                 pam_auth = radiusd
457         }
458
459         # Unix /etc/passwd style authentication
460         #
461         #
462         unix {
463                 #
464                 #  Cache /etc/passwd, /etc/shadow, and /etc/group
465                 #
466                 #  The default is to cache them.
467                 #
468                 #  For FreeBSD, you do NOT want to enable the cache,
469                 #  as it's password lookups are done via a database.
470                 #
471                 # allowed values: {no, yes}
472                 cache = yes
473
474                 # Reload the cache every 600 seconds (10mins). 0 to disable.
475                 cache_reload = 600
476
477                 #
478                 #  Define the locations of the normal passwd, shadow, and
479                 #  group files.
480                 #
481                 #  'shadow' is commented out by default, because not all
482                 #  systems have shadow passwords.
483                 #
484                 #  To force the module to use the system password functions,
485                 #  instead of reading the files, comment out the 'passwd'
486                 #  and 'shadow' configuration entries.  This is required
487                 #  for some systems, like FreeBSD.
488                 #
489                 passwd = /etc/passwd
490                 #       shadow = /etc/shadow
491                 group = /etc/group
492
493
494                 #
495                 #  Where the 'wtmp' file is located.
496                 #  This will be moved to it's own module soon..
497                 #
498                 radwtmp = ${logdir}/radwtmp
499         }
500
501         # Extensible Authentication Protocol
502         #
503         #  For all EAP related authentications 
504         eap {
505                 # Invoke the default supported EAP type when
506                 # EAP-Identity response is received
507                 #   default_eap_type = md5
508
509                 # Default expiry time to clean the EAP list,
510                 # It is maintained to co-relate the
511                 # EAP-response for each EAP-request sent.
512                 #   timer_expire     = 60
513
514                 # Supported EAP-types
515                 md5 {
516                 }
517
518                 ## FIXME: EAP-TLS is highly experimental EAP-Type at the moment.  
519                 #       Please give feedback.
520                 #tls {
521                 #       private_key_password = password
522                 #       private_key_file = /path/filename
523
524                 #       Sometimes Private key & Certificate are located
525                 #       in the same file, then private_key_file & certificate_file
526                 #       must contain the same file name.
527                 #       certificate_file = /path/filename
528
529                 #       Trusted Root CA list
530                 #       CA_file = /path/filename
531
532                 #       dh_file = /path/filename
533                 #       random_file = /path/filename
534                 #
535                 #       This can never exceed MAX_RADIUS_LEN (4096)
536                 #       preferably half the MAX_RADIUS_LEN, to
537                 #       accomodate other attributes in RADIUS packet.
538                 #       On most APs the MAX packet length is configured
539                 #       between 1500 - 1600. In these cases, fragment
540                 #       size should be <= 1024.
541                 #       fragment_size = 1024
542                 #
543                 #       include_length is a flag which is by default set to yes
544                 #       If set to yes, Total Length of the message is included
545                 #       in EVERY packet we send.
546                 #       If set to no, Total Length of the message is included
547                 #       ONLY in the First packet of a fragment series.
548                 #       include_length = yes
549                 #}
550         }
551
552         # Microsoft CHAP authentication
553         #
554         #  This module supports SAMBA passwd file authorization
555         #  and MS-CHAP, MS-CHAPv2 authentication.  However, we recommend
556         #  using the 'passwd' module, below, as it's more general.
557         #
558         mschap {
559                 # if given, passwd shows location of
560                 # SAMBA passwd file
561                 #       passwd = /etc/smbpasswd
562                 # please note that smbpasswd authorization in
563                 # mschap is for compatibility only. It works
564                 # slow and shouldn't be used.
565                 # use rlm_passwd module instead in authorize section
566                 # you can find configuration example for
567                 # passwd etc_smbpasswd
568                 # below
569
570                 # authtype value, if present, will be used
571                 # to overwrite (or add) Auth-Type during
572                 # authorization. Normally should be MS-CHAP
573                 authtype = MS-CHAP
574                 
575                 # if ignore_password set to yes mschap will
576                 # ignore password set by any other module during
577                 # authorization and will always use password file
578                 #       ignore_password = yes  
579
580                 # if use_mppe is not set to no mschap will
581                 # add MS-CHAP-MPPE-Keys for MS-CHAPv1 and
582                 # MS-MPPE-Recv-Key/MS-MPPE-Send-Key for MS-CHAPv2
583                 #       use_mppe = no
584
585                 # if mppe is enabled require_encryption makes
586                 # encryption moderate
587                 #       require_encryption = yes
588
589                 # require_strong always requires 128 bit key
590                 # encryption
591                 #       require_strong = yes
592         }
593
594         # PAP module to authenticate users based on their stored password
595         #
596         #  Supports multiple encryption schemes
597         #  clear: Clear text
598         #  crypt: Unix crypt
599         #    md5: MD5 ecnryption
600         #   sha1: SHA1 encryption.
601         #  DEFAULT: crypt
602         #pap {
603         #       encryption_scheme = crypt
604         #}
605
606         # Lightweight Directory Access Protocol (LDAP)
607         #
608         #  This module definition allows you to use LDAP for
609         #  authorization and authentication (Auth-Type := LDAP)
610         #
611         #  See doc/rlm_ldap for description of configuration options 
612         #  and sample authorize{} and authenticate{} blocks 
613         ldap {
614                 server = "ldap.your.domain"
615                 # identity = "cn=admin,o=My Org,c=UA"
616                 # password = mypass
617                 basedn = "o=My Org,c=UA"
618                 filter = "(uid=%{Stripped-User-Name:-%{User-Name}})"
619
620                 # set this to 'yes' to use TLS encrypted connections
621                 # to the LDAP database.
622                 start_tls = no
623                 # default_profile = "cn=radprofile,ou=dialup,o=My Org,c=UA"
624                 # profile_attribute = "radiusProfileDn"
625                 access_attr = "dialupAccess"
626
627                 # Mapping of RADIUS dictionary attributes to LDAP
628                 # directory attributes.
629                 dictionary_mapping = ${raddbdir}/ldap.attrmap
630
631                 # ldap_cache_timeout = 120
632                 # ldap_cache_size = 0
633                 ldap_connections_number = 5
634                 # password_header = "{clear}"
635                 # password_attribute = userPassword
636                 # groupname_attribute = cn
637                 # groupmembership_filter = "(|(&(objectClass=GroupOfNames)(member=%{Ldap-UserDn}))(&(objectClass=GroupOfUniqueNames)(uniquemember=%{Ldap-UserDn})))"
638                 # groupmembership_attribute = memberof
639                 timeout = 4
640                 timelimit = 3
641                 net_timeout = 1
642                 # compare_check_items = yes
643                 # access_attr_used_for_allow = yes
644         }
645
646         # passwd module allows to do authorization via any passwd-like
647         # file and to extract any attributes from these modules
648         #
649         # parameters are:
650         #   filename - path to filename
651         #   format - format for filename record. This parameters
652         #            correlates record in the passwd file and RADIUS
653         #            attributes.
654         #
655         #            Field marked as '*' is key field. That is, the parameter
656         #            with this name from the request is used to search for
657         #            the record from passwd file
658         #
659         #            Field marked as ',' may contain a comma separated list
660         #            of attributes.
661         #   authtype - if record found this Auth-Type is used to authenticate
662         #            user
663         #   hashsize - hashtable size. If 0 or not specified records are not
664         #            stored in memory and file is red on every request.
665         #   allowmultiplekeys - if few records for every key are allowed
666         #   ignorenislike - ignore NIS-related records
667         #   delimiter - symbol to use as a field separator in passwd file,
668         #            for format ':' symbol is always used. '\0', '\n' are
669         #            not allowed 
670         #
671         #passwd etc_smbpasswd {
672         #       filename = /etc/smbpasswd
673         #       format = "*User-Name::LM-Password:NT-Password:SMB-Account-CTRL-TEXT::"
674         #       authtype = MS-CHAP
675         #       hashsize = 100
676         #       ignorenislike = no
677         #       allowmultiplekeys = no
678         #}
679
680         #  Similar configuration, for the /etc/group file. Adds Group-Name
681         #  attribute for every group user is member of
682         #passwd etc_group {
683         #       filename = /etc/group
684         #       format = "Group-Name:::*,User-Name"
685         #       hashsize = 50
686         #       ignorenislike = yes
687         #       allowmultiplekeys = yes
688         #       delimiter = ":"
689         #}
690
691         # Realm module, for proxying.
692         #
693         #  You can have multiple instances of the realm module to
694         #  support multiple realm syntaxs at the same time.  The
695         #  search order is defined the order in the authorize and
696         #  preacct blocks after the module config block.
697         #
698         #  Two config options:
699         #       format     -  must be 'prefix' or 'suffix'
700         #       delimiter  -  must be a single character
701
702         #  'username@realm'
703         #
704         realm suffix {
705                 format = suffix
706                 delimiter = "@"
707         }
708
709         #  'realm/username'
710         #
711         #  Using this entry, IPASS users have their realm set to "IPASS".
712         realm realmslash {
713                 format = prefix
714                 delimiter = "/"
715         }
716
717         #  'username%realm'
718         #
719         realm realmpercent {
720                 format = suffix
721                 delimiter = "%"
722         }
723         
724         #  rewrite arbitrary packets.  Useful in accounting and authorization.
725         ## FIXME:  This is highly experimental at the moment.  Please give 
726         ## feedback.
727         #
728         # The module can also use the Rewrite-Rule attribute. If it is set and
729         # matches the name of the module instance, then that module instance will
730         # be the only one which runs
731         #
732         # Also if new_attribute is set to yes then a new attribute will be created
733         # containing the value replacewith and it will be added to searchin (packet,
734         # reply or config). searchfor,ignore_case and max_matches will be ignored in
735         # that case
736         #
737         #attr_rewrite sanecallerid {
738         #       attribute = Called-Station-Id
739                 # may be "packet", "reply", or "config"
740         #       searchin = packet
741         #       searchfor = "[+ ]"
742         #       replacewith = ""
743         #       ignore_case = no
744         #       new_attribute = no
745         #       max_matches = 10
746         #}
747
748         # Preprocess the incoming RADIUS request, before handing it off
749         # to other modules.
750         #
751         #  This module processes the 'huntgroups' and 'hints' files.
752         #  In addition, it re-writes some weird attributes created
753         #  by some NASes, and converts the attributes into a form which
754         #  is a little more standard.
755         #
756         preprocess {
757                 huntgroups = ${confdir}/huntgroups
758                 hints = ${confdir}/hints
759
760                 # This hack changes Ascend's wierd port numberings
761                 # to standard 0-??? port numbers so that the "+" works
762                 # for IP address assignments.
763                 with_ascend_hack = no
764                 ascend_channels_per_line = 23
765
766                 # Windows NT machines often authenticate themselves as
767                 # NT_DOMAIN\username
768                 #
769                 # If this is set to 'yes', then the NT_DOMAIN portion
770                 # of the user-name is silently discarded.
771                 with_ntdomain_hack = no
772
773                 # Specialix Jetstream 8500 24 port access server.
774                 #
775                 # If the user name is 10 characters or longer, a "/"
776                 # and the excess characters after the 10th are
777                 # appended to the user name.
778                 #
779                 # If you're not running that NAS, you don't need
780                 # this hack.
781                 with_specialix_jetstream_hack = no
782
783                 # Cisco sends it's VSA attributes with the attribute
784                 # name *again* in the string, like:
785                 #
786                 #   H323-Attribute = "h323-attribute=value".
787                 #
788                 # If this configuration item is set to 'yes', then
789                 # the redundant data in the the attribute text is stripped
790                 # out.  The result is:
791                 #
792                 #  H323-Attribute = "value"
793                 #
794                 # If you're not running a Cisco NAS, you don't need
795                 # this hack.
796                 with_cisco_vsa_hack = no
797         }
798
799         # Livingston-style 'users' file
800         #
801         files {
802                 usersfile = ${confdir}/users
803                 acctusersfile = ${confdir}/acct_users
804
805                 #  If you want to use the old Cistron 'users' file
806                 #  with FreeRADIUS, you should change the next line
807                 #  to 'compat = cistron'.  You can the copy your 'users'
808                 #  file from Cistron.
809                 compat = no
810         }
811
812         # See doc/rlm_fastusers before using this
813         # module or changing these values.
814         #
815         fastusers {
816                 usersfile = ${confdir}/users_fast
817                 hashsize = 1000
818                 compat = no
819                 # Reload the hash every 600 seconds (10mins)
820                 hash_reload = 600
821         }
822         
823         # Write a detailed log of all accounting records received.
824         #
825         detail {
826                 #  Note that we do NOT use NAS-IP-Address here, as that
827                 #  attribute MAY BE from the originating NAS, and NOT
828                 #  from the proxy which actually sent us the request.
829                 #  The Client-IP-Address attribute is ALWAYS the address
830                 #  of the client which sent us the request.
831                 #
832                 detailfile = ${radacctdir}/%{Client-IP-Address}/detail
833                 detailperm = 0600
834         }
835
836         # Create a unique accounting session Id, as many NASes re-use
837         # or repeat values for Acct-Session-Id, causing no end of confusion.
838         #
839         #  This module will add a (probably) unique session id 
840         #  to an accounting packet based on the attributes listed
841         #  below found in the packet.  see doc/rlm_acct_unique
842         #
843         acct_unique {
844                 key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port-Id"
845         }
846
847
848         # Include another file that has SQL-related stuff in it.  
849         # This is another file solely because it tends to be big.
850         #
851         #  The following configuration file is for use with MySQL.
852         #
853         # For Postgresql, use ${confdir}/postgresql.conf
854         # For MS-SQL, use ${confdir}/mssql.conf
855         #
856         $INCLUDE  ${confdir}/sql.conf
857
858         # Write a 'utmp' style log file, of which users are currently
859         # logged in, and where they've logged in from.
860         #
861         radutmp {
862                 filename = ${logdir}/radutmp
863
864                 # Set the file permissions, as the contents of this file
865                 # are usually private.
866                 perm = 0600
867                 callerid = "yes"
868         }
869
870         # "Safe" radutmp - does not contain caller ID, so it can be
871         # world-readable, and radwho can work for normal users, without
872         # exposing any information that isn't already exposed by who(1).
873         #
874         # This is another instance of the radutmp module, but it is given
875         # then name "sradutmp" to identify it later in the "accounting"
876         # section.
877         radutmp sradutmp {
878                 filename = ${logdir}/sradutmp
879                 perm = 0644
880                 callerid = "no"
881         }
882
883         # attr_filter - filters the attributes received in replies from
884         # proxied servers, to make sure we send back to our RADIUS client
885         # only allowed attributes.
886         attr_filter {
887                 attrsfile = ${confdir}/attrs
888         }
889
890         #  This module takes an attribute (count-attribute), which MUST
891         #  be an 'integer' or 'time' attribute.  It also takes a key,
892         #  and creates a counter for each unique key.  The count is
893         #  incremented when accounting packets are received by the
894         #  server.  The value of the increment is the value of the
895         #  count-attribute.
896         #
897         #  The 'reset' parameter defines when the counters are all reset to
898         #  zero.  It can be hourly, daily, weekly, monthly or never.
899         #  It can also be user defined. It should be of the form:
900         #  num[hdwm] where:
901         #  h: hours, d: days, w: weeks, m: months
902         #  If the letter is ommited days will be assumed. In example:
903         #  reset = 10h (reset every 10 hours)
904         #  reset = 12  (reset every 12 days)
905         #
906         #  The counter-name is the name of the attribute in the 'users'
907         #  file used to access that counter.  e.g.
908         #
909         #  DEFAULT  Daily-Session-Time > 3600, Auth-Type = Reject
910         #      Reply-Message = "You've used up more than one hour today"
911         #
912         # You can also use the check-name attribute (Max-Daily-Session etc).
913         # You can use that attribute to make per user/group counter setups:
914         #
915         # DEFAULT Ldap-Group == "faculty", Max-Daily-Session := 21600
916         #
917         # DEFAULT Ldap-Group == "students", Max-Daily-Session := 10800
918         #
919         #
920         # The allowed-servicetype attribute can be used to only take
921         # into account specific sessions. For example if a user first
922         # logs in through a login menu and then selects ppp there will
923         # be two sessions. One for Login-User and one for Framed-User
924         # service type. We only need to take into account the second one.
925         #
926         counter {
927                 filename = ${raddbdir}/db.counter
928                 key = User-Name
929                 count-attribute = Acct-Session-Time
930                 reset = daily
931                 counter-name = Daily-Session-Time
932                 check-name = Max-Daily-Session
933                 allowed-servicetype = Framed-User
934                 cache-size = 5000
935         }
936
937         # The "always" module is here for debugging purposes. Each instance simply
938         # returns the same result, always, without doing anything.
939         always fail {
940                 rcode = fail
941         }
942         always reject {
943                 rcode = reject
944         }
945         always ok {
946                 rcode = ok
947                 simulcount = 0
948                 mpp = no
949         }
950
951         # ANSI X9.9 token support.  Not included by default.
952         # $INCLUDE  ${confdir}/x99.conf
953
954 }
955
956 # Instantiation
957 #
958 # This section orders the loading of the modules.  Modules
959 # listed here will get loaded BEFORE the later sections like
960 # authorize, authenticate, etc. get examined.
961 #
962 # This section is not strictly needed.  When a section like
963 # authorize refers to a module, it's automatically loaded and
964 # initialized.  However, some modules may not be listed in any
965 # of the following sections, so they can be listed here.
966 #
967 # Also, listing modules here ensures that you have control over
968 # the order in which they are initalized.  If one module needs
969 # something defined by another module, you can list them in order
970 # here, and ensure that the configuration will be OK.
971 #
972 instantiate {
973
974 }
975
976 # Authorization. First preprocess (hints and huntgroups files),
977 # then realms, and finally look in the "users" file.
978 # The order of the realm modules will determine the order that
979 # we try to find a matching realm.
980 # Make *sure* that 'preprocess' comes before any realm if you 
981 # need to setup hints for the remote radius server
982 authorize {
983         #
984         # The preprocess module takes care of sanitizing some bizarre
985         # attributes in the request, and turning them into attributes
986         # which are more standard.
987         #
988         # It takes care of processing the 'raddb/hints' and the
989         # 'raddb/huntgroups' files.
990         #
991         # It also adds a Client-IP-Address attribute to the request.
992         #
993         preprocess
994         
995         #
996         # The chap module will set 'Auth-Type := CHAP' if we are
997         # handling a CHAP request and Auth-Type has not already been set
998         #
999 #       chap
1000
1001 #       counter
1002 #       attr_filter
1003 #       eap
1004         suffix
1005         files
1006 #       etc_smbpasswd
1007
1008         #
1009         #  Uncomment 'mschap' if the users are logging in with an
1010         #  MS-CHAP-Challenge attribute for authentication.  The mschap
1011         #  module will find the MS-CHAP-Challenge attribute, and add
1012         #  'Auth-Type := MS-CHAP' to the request, which makes it use
1013         #  the mschap module for authentication.
1014         #
1015 #       mschap
1016
1017 # The ldap module will set Auth-Type to LDAP if it has not already been set
1018 #       ldap
1019 }
1020
1021
1022 # Authentication.
1023 #
1024 # This section lists which modules are available for authentication.
1025 # Note that it does NOT mean 'try each module in order'.  It means
1026 # that you have to have a module from the 'authorize' section add
1027 # a configuration attribute 'Auth-Type := FOO'.  That authentication type
1028 # is then used to pick the apropriate module from the list below.
1029 #
1030 # The default Auth-Type is Local. That is, whatever is not included inside
1031 # an authtype section will be called only if Auth-Type is set to Local
1032 #
1033 # So you should do the following:
1034 # Set Auth-Type to an appropriate value in the authorize section. For example chap
1035 # will set Auth-Type to CHAP, ldap to LDAP etc
1036 # After that create corresponding authtype sections in the authenticate section below
1037 # and call the appropriate modules (chap for CHAP etc)
1038 authenticate {
1039 #       pam
1040         unix
1041
1042         # Uncomment it if you want to use ldap for authentication
1043 #       authtype LDAP {
1044 #               ldap
1045 #       }
1046 #       mschap
1047 #       eap
1048
1049         # Uncomment it if you want to support CHAP
1050 #       authtype CHAP {
1051 #               chap
1052 #       }
1053
1054         # Uncomment the following if you want to support PAP and you
1055         # extract user passwords from the user database (LDAP,SQL, etc).
1056         # You should use the 'files'module to set 'Auth-Type := PAP' for
1057         # this to work.
1058 #       authtype PAP {
1059 #               pap
1060 #       }
1061 #
1062 }
1063
1064
1065 # Pre-accounting. Look for proxy realm in order of realms, then 
1066 # acct_users file, then preprocess (hints file).
1067 preacct {
1068         preprocess
1069         suffix
1070         files
1071 }
1072
1073
1074 # Accounting. Log to detail file, and to the radwtmp file, and maintain
1075 # radutmp.
1076 accounting {
1077 #       acct_unique
1078         detail
1079 #       counter
1080         unix
1081         radutmp
1082 #       sradutmp
1083 }
1084
1085
1086 # Session database, used for checking Simultaneous-Use. Either the radutmp 
1087 # or rlm_sql module can handle this
1088 session {
1089         radutmp
1090 #       sql
1091 }