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