Moved "authorize", "accounting", etc into the "default"
[freeradius.git] / raddb / sites-available / default
1 ######################################################################
2 #
3 #       As of 2.0.0, FreeRADIUS supports virtual hosts using the
4 #       "server" section, and configuration directives.
5 #
6 #       Virtual hosts should be put into the "sites-available"
7 #       directory.  Soft links should be created in the "sites-enabled"
8 #       directory to these files.  This is done in a normal installation.
9 #
10 #       $Id$
11 #
12 #
13 ######################################################################
14
15 #  Authorization. First preprocess (hints and huntgroups files),
16 #  then realms, and finally look in the "users" file.
17 #
18 #  The order of the realm modules will determine the order that
19 #  we try to find a matching realm.
20 #
21 #  Make *sure* that 'preprocess' comes before any realm if you 
22 #  need to setup hints for the remote radius server
23 authorize {
24         #
25         #  The preprocess module takes care of sanitizing some bizarre
26         #  attributes in the request, and turning them into attributes
27         #  which are more standard.
28         #
29         #  It takes care of processing the 'raddb/hints' and the
30         #  'raddb/huntgroups' files.
31         #
32         #  It also adds the %{Client-IP-Address} attribute to the request.
33         preprocess
34
35         #
36         #  If you want to have a log of authentication requests,
37         #  un-comment the following line, and the 'detail auth_log'
38         #  section, above.
39 #       auth_log
40
41         #
42         #  The chap module will set 'Auth-Type := CHAP' if we are
43         #  handling a CHAP request and Auth-Type has not already been set
44         chap
45
46         #
47         #  If the users are logging in with an MS-CHAP-Challenge
48         #  attribute for authentication, the mschap module will find
49         #  the MS-CHAP-Challenge attribute, and add 'Auth-Type := MS-CHAP'
50         #  to the request, which will cause the server to then use
51         #  the mschap module for authentication.
52         mschap
53
54         #
55         #  Pull crypt'd passwords from /etc/passwd or /etc/shadow,
56         #  using the system API's to get the password.  If you want
57         #  to read /etc/passwd or /etc/shadow directly, see the
58         #  passwd module, above.
59         #
60         unix
61
62         #
63         #  If you have a Cisco SIP server authenticating against
64         #  FreeRADIUS, uncomment the following line, and the 'digest'
65         #  line in the 'authenticate' section.
66 #       digest
67
68         #
69         #  Look for IPASS style 'realm/', and if not found, look for
70         #  '@realm', and decide whether or not to proxy, based on
71         #  that.
72 #       IPASS
73
74         #
75         #  If you are using multiple kinds of realms, you probably
76         #  want to set "ignore_null = yes" for all of them.
77         #  Otherwise, when the first style of realm doesn't match,
78         #  the other styles won't be checked.
79         #
80         suffix
81 #       ntdomain
82
83         #
84         #  This module takes care of EAP-MD5, EAP-TLS, and EAP-LEAP
85         #  authentication.
86         #
87         #  It also sets the EAP-Type attribute in the request
88         #  attribute list to the EAP type from the packet.
89         #
90         #  As of 2.0, the EAP module returns "ok" in the authorize stage
91         #  for TTLS and PEAP.  In 1.x, it never returned "ok" here, so
92         #  this change is compatible with older configurations.
93         #
94         #  The example below uses module failover to avoid querying all
95         #  of the following modules if the EAP module returns "ok".
96         #  Therefore, your LDAP and/or SQL servers will not be queried
97         #  for the many packets that go back and forth to set up TTLS
98         #  or PEAP.  The load on those servers will therefore be reduced.
99         #
100         eap {
101                 ok = return
102         }
103
104         #
105         #  Read the 'users' file
106         files
107
108         #
109         #  Look in an SQL database.  The schema of the database
110         #  is meant to mirror the "users" file.
111         #
112         #  See "Authorization Queries" in sql.conf
113 #       sql
114
115         #
116         #  If you are using /etc/smbpasswd, and are also doing
117         #  mschap authentication, the un-comment this line, and
118         #  configure the 'etc_smbpasswd' module, above.
119 #       etc_smbpasswd
120
121         #
122         #  The ldap module will set Auth-Type to LDAP if it has not
123         #  already been set
124 #       ldap
125
126         #
127         #  Enforce daily limits on time spent logged in.
128 #       daily
129
130         #
131         # Use the checkval module
132 #       checkval
133
134         expiration
135         logintime
136
137         #
138         #  If no other module has claimed responsibility for
139         #  authentication, then try to use PAP.  This allows the
140         #  other modules listed above to add a "known good" password
141         #  to the request, and to do nothing else.  The PAP module
142         #  will then see that password, and use it to do PAP
143         #  authentication.
144         #
145         #  This module should be listed last, so that the other modules
146         #  get a chance to set Auth-Type for themselves.
147         #
148         pap
149
150
151         #
152         #  If "status_server = yes", then Status-Server messages are passed
153         #  through the following section, and ONLY the following section.
154         #  This permits you to do DB queries, for example.  If the modules
155         #  listed here return "fail", then NO response is sent.
156         #
157 #       Autz-Type Status-Server {
158 #
159 #       }
160 }
161
162
163 #  Authentication.
164 #
165 #
166 #  This section lists which modules are available for authentication.
167 #  Note that it does NOT mean 'try each module in order'.  It means
168 #  that a module from the 'authorize' section adds a configuration
169 #  attribute 'Auth-Type := FOO'.  That authentication type is then
170 #  used to pick the apropriate module from the list below.
171 #
172
173 #  In general, you SHOULD NOT set the Auth-Type attribute.  The server
174 #  will figure it out on its own, and will do the right thing.  The
175 #  most common side effect of erroneously setting the Auth-Type
176 #  attribute is that one authentication method will work, but the
177 #  others will not.
178 #
179 #  The common reasons to set the Auth-Type attribute by hand
180 #  is to either forcibly reject the user, or forcibly accept him.
181 #
182 authenticate {
183         #
184         #  PAP authentication, when a back-end database listed
185         #  in the 'authorize' section supplies a password.  The
186         #  password can be clear-text, or encrypted.
187         Auth-Type PAP {
188                 pap
189         }
190
191         #
192         #  Most people want CHAP authentication
193         #  A back-end database listed in the 'authorize' section
194         #  MUST supply a CLEAR TEXT password.  Encrypted passwords
195         #  won't work.
196         Auth-Type CHAP {
197                 chap
198         }
199
200         #
201         #  MSCHAP authentication.
202         Auth-Type MS-CHAP {
203                 mschap
204         }
205
206         #
207         #  If you have a Cisco SIP server authenticating against
208         #  FreeRADIUS, uncomment the following line, and the 'digest'
209         #  line in the 'authorize' section.
210 #       digest
211
212         #
213         #  Pluggable Authentication Modules.
214 #       pam
215
216         #
217         #  See 'man getpwent' for information on how the 'unix'
218         #  module checks the users password.  Note that packets
219         #  containing CHAP-Password attributes CANNOT be authenticated
220         #  against /etc/passwd!  See the FAQ for details.
221         #  
222         unix
223
224         # Uncomment it if you want to use ldap for authentication
225         #
226         # Note that this means "check plain-text password against
227         # the ldap database", which means that EAP won't work,
228         # as it does not supply a plain-text password.
229 #       Auth-Type LDAP {
230 #               ldap
231 #       }
232
233         #
234         #  Allow EAP authentication.
235         eap
236 }
237
238
239 #
240 #  Pre-accounting.  Decide which accounting type to use.
241 #
242 preacct {
243         preprocess
244
245         #
246         #  Ensure that we have a semi-unique identifier for every
247         #  request, and many NAS boxes are broken.
248         acct_unique
249
250         #
251         #  Look for IPASS-style 'realm/', and if not found, look for
252         #  '@realm', and decide whether or not to proxy, based on
253         #  that.
254         #
255         #  Accounting requests are generally proxied to the same
256         #  home server as authentication requests.
257 #       IPASS
258         suffix
259 #       ntdomain
260
261         #
262         #  Read the 'acct_users' file
263         files
264 }
265
266 #
267 #  Accounting.  Log the accounting data.
268 #
269 accounting {
270         #
271         #  Create a 'detail'ed log of the packets.
272         #  Note that accounting requests which are proxied
273         #  are also logged in the detail file.
274         detail
275 #       daily
276
277         #  Update the wtmp file
278         #
279         #  If you don't use "radlast", you can delete this line.
280         unix
281
282         #
283         #  For Simultaneous-Use tracking.
284         #
285         #  Due to packet losses in the network, the data here
286         #  may be incorrect.  There is little we can do about it.
287         radutmp
288 #       sradutmp
289
290         #  Return an address to the IP Pool when we see a stop record.
291 #       main_pool
292
293         #
294         #  Log traffic to an SQL database.
295         #
296         #  See "Accounting queries" in sql.conf
297 #       sql
298
299         #
300         #  Instead of sending the query to the SQL server,
301         #  write it into a log file.
302         #
303 #       sql_log
304
305         #  Cisco VoIP specific bulk accounting
306 #       pgsql-voip
307
308         #  Filter attributes from the accounting response.
309         attr_filter.accounting_response
310 }
311
312
313 #  Session database, used for checking Simultaneous-Use. Either the radutmp 
314 #  or rlm_sql module can handle this.
315 #  The rlm_sql module is *much* faster
316 session {
317         radutmp
318
319         #
320         #  See "Simultaneous Use Checking Queries" in sql.conf
321 #       sql
322
323         #
324         #  See "Autz-Type Status-Server" for how this works.
325         #
326 #       Acct-Type Status-Server {
327 #
328 #       }
329 }
330
331
332 #  Post-Authentication
333 #  Once we KNOW that the user has been authenticated, there are
334 #  additional steps we can take.
335 post-auth {
336         #  Get an address from the IP Pool.
337 #       main_pool
338
339         #
340         #  If you want to have a log of authentication replies,
341         #  un-comment the following line, and the 'detail reply_log'
342         #  section, above.
343 #       reply_log
344
345         #
346         #  After authenticating the user, do another SQL query.
347         #
348         #  See "Authentication Logging Queries" in sql.conf
349 #       sql
350
351         #
352         #  Instead of sending the query to the SQL server,
353         #  write it into a log file.
354         #
355 #       sql_log
356
357         #
358         #  Un-comment the following if you have set
359         #  'edir_account_policy_check = yes' in the ldap module sub-section of
360         #  the 'modules' section.
361         #
362 #       ldap
363
364         #
365         #  Access-Reject packets are sent through the REJECT sub-section of the
366         #  post-auth section.
367         #
368         #  Add the ldap module name (or instance) if you have set 
369         #  'edir_account_policy_check = yes' in the ldap module configuration
370         #
371         Post-Auth-Type REJECT {
372                 attr_filter.access_reject
373         }
374 }
375
376 #
377 #  When the server decides to proxy a request to a home server,
378 #  the proxied request is first passed through the pre-proxy
379 #  stage.  This stage can re-write the request, or decide to
380 #  cancel the proxy.
381 #
382 #  Only a few modules currently have this method.
383 #
384 pre-proxy {
385 #       attr_rewrite
386
387         #  Uncomment the following line if you want to change attributes
388         #  as defined in the preproxy_users file.
389 #       files
390
391         #  Uncomment the following line if you want to filter requests
392         #  sent to remote servers based on the rules defined in the
393         #  'attrs.pre-proxy' file.
394 #       attr_filter.pre-proxy
395
396         #  If you want to have a log of packets proxied to a home
397         #  server, un-comment the following line, and the
398         #  'detail pre_proxy_log' section, above.
399 #       pre_proxy_log
400 }
401
402 #
403 #  When the server receives a reply to a request it proxied
404 #  to a home server, the request may be massaged here, in the
405 #  post-proxy stage.
406 #
407 post-proxy {
408
409         #  If you want to have a log of replies from a home server,
410         #  un-comment the following line, and the 'detail post_proxy_log'
411         #  section, above.
412 #       post_proxy_log
413
414 #       attr_rewrite
415
416         #  Uncomment the following line if you want to filter replies from
417         #  remote proxies based on the rules defined in the 'attrs' file.
418 #       attr_filter.post-proxy
419
420         #
421         #  If you are proxying LEAP, you MUST configure the EAP
422         #  module, and you MUST list it here, in the post-proxy
423         #  stage.
424         #
425         #  You MUST also use the 'nostrip' option in the 'realm'
426         #  configuration.  Otherwise, the User-Name attribute
427         #  in the proxied request will not match the user name
428         #  hidden inside of the EAP packet, and the end server will
429         #  reject the EAP request.
430         #
431         eap
432
433         #
434         #  If the server tries to proxy a request and fails, then the
435         #  request is processed through the modules in this section.
436         #
437         #  The main use of this section is to permit robust proxying
438         #  of accounting packets.  The server can be configured to
439         #  proxy accounting packets as part of normal processing.
440         #  Then, if the home server goes down, accounting packets can
441         #  be logged to a local "detail" file, for processing with
442         #  radrelay.  When the home server comes back up, radrelay
443         #  will read the detail file, and send the packets to the
444         #  home server.
445         #
446         #  With this configuration, the server always responds to
447         #  Accounting-Requests from the NAS, but only writes
448         #  accounting packets to disk if the home server is down.
449         #
450 #       Post-Proxy-Type Fail {
451 #                       detail
452 #       }
453
454 }