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