corrected typo
[freeradius.git] / raddb / sites-available / inner-tunnel
1 # -*- text -*-
2 ######################################################################
3 #
4 #       This is a virtual server that handles *only* inner tunnel
5 #       requests for EAP-TTLS and PEAP types.
6 #
7 #       $Id$
8 #
9 ######################################################################
10
11 server inner-tunnel {
12
13 #  Authorization. First preprocess (hints and huntgroups files),
14 #  then realms, and finally look in the "users" file.
15 #
16 #  The order of the realm modules will determine the order that
17 #  we try to find a matching realm.
18 #
19 #  Make *sure* that 'preprocess' comes before any realm if you 
20 #  need to setup hints for the remote radius server
21 authorize {
22         #
23         #  The chap module will set 'Auth-Type := CHAP' if we are
24         #  handling a CHAP request and Auth-Type has not already been set
25         chap
26
27         #
28         #  If the users are logging in with an MS-CHAP-Challenge
29         #  attribute for authentication, the mschap module will find
30         #  the MS-CHAP-Challenge attribute, and add 'Auth-Type := MS-CHAP'
31         #  to the request, which will cause the server to then use
32         #  the mschap module for authentication.
33         mschap
34
35         #
36         #  Pull crypt'd passwords from /etc/passwd or /etc/shadow,
37         #  using the system API's to get the password.  If you want
38         #  to read /etc/passwd or /etc/shadow directly, see the
39         #  passwd module, above.
40         #
41         unix
42
43         #
44         #  Look for IPASS style 'realm/', and if not found, look for
45         #  '@realm', and decide whether or not to proxy, based on
46         #  that.
47 #       IPASS
48
49         #
50         #  If you are using multiple kinds of realms, you probably
51         #  want to set "ignore_null = yes" for all of them.
52         #  Otherwise, when the first style of realm doesn't match,
53         #  the other styles won't be checked.
54         #
55         suffix
56 #       ntdomain
57
58         #
59         #  This module takes care of EAP-MSCHAPv2 authentication.
60         #
61         #  It also sets the EAP-Type attribute in the request
62         #  attribute list to the EAP type from the packet.
63         #
64         #  The example below uses module failover to avoid querying all
65         #  of the following modules if the EAP module returns "ok".
66         #  Therefore, your LDAP and/or SQL servers will not be queried
67         #  for the many packets that go back and forth to set up TTLS
68         #  or PEAP.  The load on those servers will therefore be reduced.
69         #
70         eap {
71                 ok = return
72         }
73
74         #
75         #  Read the 'users' file
76         files
77
78         #
79         #  Look in an SQL database.  The schema of the database
80         #  is meant to mirror the "users" file.
81         #
82         #  See "Authorization Queries" in sql.conf
83 #       sql
84
85         #
86         #  If you are using /etc/smbpasswd, and are also doing
87         #  mschap authentication, the un-comment this line, and
88         #  configure the 'etc_smbpasswd' module, above.
89 #       etc_smbpasswd
90
91         #
92         #  The ldap module will set Auth-Type to LDAP if it has not
93         #  already been set
94 #       ldap
95
96         #
97         #  Enforce daily limits on time spent logged in.
98 #       daily
99
100         #
101         # Use the checkval module
102 #       checkval
103
104         expiration
105         logintime
106
107         #
108         #  If no other module has claimed responsibility for
109         #  authentication, then try to use PAP.  This allows the
110         #  other modules listed above to add a "known good" password
111         #  to the request, and to do nothing else.  The PAP module
112         #  will then see that password, and use it to do PAP
113         #  authentication.
114         #
115         #  This module should be listed last, so that the other modules
116         #  get a chance to set Auth-Type for themselves.
117         #
118         pap
119 }
120
121
122 #  Authentication.
123 #
124 #
125 #  This section lists which modules are available for authentication.
126 #  Note that it does NOT mean 'try each module in order'.  It means
127 #  that a module from the 'authorize' section adds a configuration
128 #  attribute 'Auth-Type := FOO'.  That authentication type is then
129 #  used to pick the apropriate module from the list below.
130 #
131
132 #  In general, you SHOULD NOT set the Auth-Type attribute.  The server
133 #  will figure it out on its own, and will do the right thing.  The
134 #  most common side effect of erroneously setting the Auth-Type
135 #  attribute is that one authentication method will work, but the
136 #  others will not.
137 #
138 #  The common reasons to set the Auth-Type attribute by hand
139 #  is to either forcibly reject the user, or forcibly accept him.
140 #
141 authenticate {
142         #
143         #  PAP authentication, when a back-end database listed
144         #  in the 'authorize' section supplies a password.  The
145         #  password can be clear-text, or encrypted.
146         Auth-Type PAP {
147                 pap
148         }
149
150         #
151         #  Most people want CHAP authentication
152         #  A back-end database listed in the 'authorize' section
153         #  MUST supply a CLEAR TEXT password.  Encrypted passwords
154         #  won't work.
155         Auth-Type CHAP {
156                 chap
157         }
158
159         #
160         #  MSCHAP authentication.
161         Auth-Type MS-CHAP {
162                 mschap
163         }
164
165         #
166         #  Pluggable Authentication Modules.
167 #       pam
168
169         #
170         #  See 'man getpwent' for information on how the 'unix'
171         #  module checks the users password.  Note that packets
172         #  containing CHAP-Password attributes CANNOT be authenticated
173         #  against /etc/passwd!  See the FAQ for details.
174         #  
175         unix
176
177         # Uncomment it if you want to use ldap for authentication
178         #
179         # Note that this means "check plain-text password against
180         # the ldap database", which means that EAP won't work,
181         # as it does not supply a plain-text password.
182 #       Auth-Type LDAP {
183 #               ldap
184 #       }
185
186         #
187         #  Allow EAP authentication.
188         eap
189 }
190
191 ######################################################################
192 #
193 #       There are no accounting requests inside of EAP-TTLS or PEAP
194 #       tunnels.
195 #
196 ######################################################################
197
198
199 #  Session database, used for checking Simultaneous-Use. Either the radutmp 
200 #  or rlm_sql module can handle this.
201 #  The rlm_sql module is *much* faster
202 session {
203         radutmp
204
205         #
206         #  See "Simultaneous Use Checking Queries" in sql.conf
207 #       sql
208 }
209
210
211 #  Post-Authentication
212 #  Once we KNOW that the user has been authenticated, there are
213 #  additional steps we can take.
214 post-auth {
215         # Note that we do NOT assign IP addresses here.
216         # If you try to assign IP addresses for EAP authentication types,
217         # it WILL NOT WORK.  You MUST use DHCP.
218
219         #
220         #  If you want to have a log of authentication replies,
221         #  un-comment the following line, and the 'detail reply_log'
222         #  section, above.
223 #       reply_log
224
225         #
226         #  After authenticating the user, do another SQL query.
227         #
228         #  See "Authentication Logging Queries" in sql.conf
229 #       sql
230
231         #
232         #  Instead of sending the query to the SQL server,
233         #  write it into a log file.
234         #
235 #       sql_log
236
237         #
238         #  Un-comment the following if you have set
239         #  'edir_account_policy_check = yes' in the ldap module sub-section of
240         #  the 'modules' section.
241         #
242 #       ldap
243
244         #
245         #  Access-Reject packets are sent through the REJECT sub-section of the
246         #  post-auth section.
247         #
248         #  Add the ldap module name (or instance) if you have set 
249         #  'edir_account_policy_check = yes' in the ldap module configuration
250         #
251         Post-Auth-Type REJECT {
252                 attr_filter.access_reject
253         }
254
255         #
256         #  The example policy below updates the outer tunnel reply
257         #  (usually Access-Accept) with the User-Name from the inner
258         #  tunnel User-Name.  Since this section is processed in the
259         #  context of the inner tunnel, "request" here means "inner
260         #  tunnel request", and "outer.reply" means "outer tunnel
261         #  reply attributes".
262         #
263         #  This example is most useful when the outer session contains
264         #  a User-Name of "anonymous@....", or a MAC address.  If it
265         #  is enabled, the NAS SHOULD use the inner tunnel User-Name
266         #  in subsequent accounting packets.  This makes it easier to
267         #  track user sessions, as they will all be based on the real
268         #  name, and not on "anonymous".
269         #
270         #  The problem with doing this is that it ALSO exposes the
271         #  real user name to any intermediate proxies.  People use
272         #  "anonymous" identifiers outside of the tunnel for a very
273         #  good reason: it gives them more privacy.  Setting the reply
274         #  to contain the real user name removes ALL privacy from
275         #  their session.
276         #
277         #  If you want privacy to remain, see the
278         #  Chargeable-User-Identity attribute from RFC 4372.  In order
279         #  to use that attribute, you will have to allocate a
280         #  per-session identifier for the user, and store it in a
281         #  long-term database (e.g. SQL).  You should also use that
282         #  attribute INSTEAD of the configuration below.
283         #
284         #update outer.reply {
285         #       User-Name = "%{request:User-Name}"
286         #}
287
288 }
289
290 #
291 #  When the server decides to proxy a request to a home server,
292 #  the proxied request is first passed through the pre-proxy
293 #  stage.  This stage can re-write the request, or decide to
294 #  cancel the proxy.
295 #
296 #  Only a few modules currently have this method.
297 #
298 pre-proxy {
299 #       attr_rewrite
300
301         #  Uncomment the following line if you want to change attributes
302         #  as defined in the preproxy_users file.
303 #       files
304
305         #  Uncomment the following line if you want to filter requests
306         #  sent to remote servers based on the rules defined in the
307         #  'attrs.pre-proxy' file.
308 #       attr_filter.pre-proxy
309
310         #  If you want to have a log of packets proxied to a home
311         #  server, un-comment the following line, and the
312         #  'detail pre_proxy_log' section, above.
313 #       pre_proxy_log
314 }
315
316 #
317 #  When the server receives a reply to a request it proxied
318 #  to a home server, the request may be massaged here, in the
319 #  post-proxy stage.
320 #
321 post-proxy {
322
323         #  If you want to have a log of replies from a home server,
324         #  un-comment the following line, and the 'detail post_proxy_log'
325         #  section, above.
326 #       post_proxy_log
327
328 #       attr_rewrite
329
330         #  Uncomment the following line if you want to filter replies from
331         #  remote proxies based on the rules defined in the 'attrs' file.
332 #       attr_filter.post-proxy
333
334         #
335         #  If you are proxying LEAP, you MUST configure the EAP
336         #  module, and you MUST list it here, in the post-proxy
337         #  stage.
338         #
339         #  You MUST also use the 'nostrip' option in the 'realm'
340         #  configuration.  Otherwise, the User-Name attribute
341         #  in the proxied request will not match the user name
342         #  hidden inside of the EAP packet, and the end server will
343         #  reject the EAP request.
344         #
345         eap
346
347         #
348         #  If the server tries to proxy a request and fails, then the
349         #  request is processed through the modules in this section.
350         #
351         #  The main use of this section is to permit robust proxying
352         #  of accounting packets.  The server can be configured to
353         #  proxy accounting packets as part of normal processing.
354         #  Then, if the home server goes down, accounting packets can
355         #  be logged to a local "detail" file, for processing with
356         #  radrelay.  When the home server comes back up, radrelay
357         #  will read the detail file, and send the packets to the
358         #  home server.
359         #
360         #  With this configuration, the server always responds to
361         #  Accounting-Requests from the NAS, but only writes
362         #  accounting packets to disk if the home server is down.
363         #
364 #       Post-Proxy-Type Fail {
365 #                       detail
366 #       }
367
368 }
369
370 } # inner-tunnel server block