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