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