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