Merge tag 'release_3_0_10' into tr-integ
[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         #  enable the "smbpasswd" module.
138 #       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         expiration
149         logintime
150
151         #
152         #  If no other module has claimed responsibility for
153         #  authentication, then try to use PAP.  This allows the
154         #  other modules listed above to add a "known good" password
155         #  to the request, and to do nothing else.  The PAP module
156         #  will then see that password, and use it to do PAP
157         #  authentication.
158         #
159         #  This module should be listed last, so that the other modules
160         #  get a chance to set Auth-Type for themselves.
161         #
162         pap
163 }
164
165
166 #  Authentication.
167 #
168 #
169 #  This section lists which modules are available for authentication.
170 #  Note that it does NOT mean 'try each module in order'.  It means
171 #  that a module from the 'authorize' section adds a configuration
172 #  attribute 'Auth-Type := FOO'.  That authentication type is then
173 #  used to pick the appropriate module from the list below.
174 #
175
176 #  In general, you SHOULD NOT set the Auth-Type attribute.  The server
177 #  will figure it out on its own, and will do the right thing.  The
178 #  most common side effect of erroneously setting the Auth-Type
179 #  attribute is that one authentication method will work, but the
180 #  others will not.
181 #
182 #  The common reasons to set the Auth-Type attribute by hand
183 #  is to either forcibly reject the user, or forcibly accept him.
184 #
185 authenticate {
186         #
187         #  PAP authentication, when a back-end database listed
188         #  in the 'authorize' section supplies a password.  The
189         #  password can be clear-text, or encrypted.
190         Auth-Type PAP {
191                 pap
192         }
193
194         #
195         #  Most people want CHAP authentication
196         #  A back-end database listed in the 'authorize' section
197         #  MUST supply a CLEAR TEXT password.  Encrypted passwords
198         #  won't work.
199         Auth-Type CHAP {
200                 chap
201         }
202
203         #
204         #  MSCHAP authentication.
205         Auth-Type MS-CHAP {
206                 mschap
207         }
208
209         #
210         #  Pluggable Authentication Modules.
211 #       pam
212
213         # Uncomment it if you want to use ldap for authentication
214         #
215         # Note that this means "check plain-text password against
216         # the ldap database", which means that EAP won't work,
217         # as it does not supply a plain-text password.
218         #
219         #  We do NOT recommend using this.  LDAP servers are databases.
220         #  They are NOT authentication servers.  FreeRADIUS is an
221         #  authentication server, and knows what to do with authentication.
222         #  LDAP servers do not.
223         #
224 #       Auth-Type LDAP {
225 #               ldap
226 #       }
227
228         #
229         #  Allow EAP authentication.
230         eap
231 }
232
233 ######################################################################
234 #
235 #       There are no accounting requests inside of EAP-TTLS or PEAP
236 #       tunnels.
237 #
238 ######################################################################
239
240
241 #  Session database, used for checking Simultaneous-Use. Either the radutmp
242 #  or rlm_sql module can handle this.
243 #  The rlm_sql module is *much* faster
244 session {
245         radutmp
246
247         #
248         #  See "Simultaneous Use Checking Queries" in sql.conf
249 #       sql
250 }
251
252
253 #  Post-Authentication
254 #  Once we KNOW that the user has been authenticated, there are
255 #  additional steps we can take.
256 #
257 #  Note that the last packet of the inner-tunnel authentication
258 #  MAY NOT BE the last packet of the outer session.  So updating
259 #  the outer reply MIGHT work, and sometimes MIGHT NOT.  The
260 #  exact functionality depends on both the inner and outer
261 #  authentication methods.
262 #
263 #  If you need to send a reply attribute in the outer session,
264 #  the ONLY safe way is to set "use_tunneled_reply = yes", and
265 #  then update the inner-tunnel reply.
266 post-auth {
267         #  If you want privacy to remain, see the
268         #  Chargeable-User-Identity attribute from RFC 4372.
269         #  If you want to use it just uncomment the line below.
270 #       cui-inner
271
272         #
273         #  If you want to have a log of authentication replies,
274         #  un-comment the following line, and enable the
275         #  'detail reply_log' module.
276 #       reply_log
277
278         #
279         #  After authenticating the user, do another SQL query.
280         #
281         #  See "Authentication Logging Queries" in sql.conf
282         -sql
283
284         #
285         #  Instead of sending the query to the SQL server,
286         #  write it into a log file.
287         #
288 #       sql_log
289
290         #
291         #  Un-comment the following if you have set
292         #  'edir_account_policy_check = yes' in the ldap module sub-section of
293         #  the 'modules' section.
294         #
295 #       ldap
296
297
298         #
299         #  Instead of "use_tunneled_reply", uncomment the
300         #  next two "update" blocks.
301         #
302 #       update {
303 #               &outer.session-state: += &reply:
304 #       }
305
306         #
307         #  These attributes are for the inner session only.
308         #  They MUST NOT be sent in the outer reply.
309         #
310         #  If you uncomment the previous block and leave
311         #  this one commented out, WiFi WILL NOT WORK,
312         #  because the client will get two MS-MPPE-keys
313         #
314 #       update outer.session-state {
315 #               MS-MPPE-Encryption-Policy !* ANY
316 #               MS-MPPE-Encryption-Types !* ANY
317 #               MS-MPPE-Send-Key !* ANY
318 #               MS-MPPE-Recv-Key !* ANY
319 #               Message-Authenticator !* ANY
320 #               EAP-Message !* ANY
321 #               Proxy-State !* ANY
322 #       }
323
324         #
325         #  Access-Reject packets are sent through the REJECT sub-section of the
326         #  post-auth section.
327         #
328         #  Add the ldap module name (or instance) if you have set
329         #  'edir_account_policy_check = yes' in the ldap module configuration
330         #
331         Post-Auth-Type REJECT {
332                 # log failed authentications in SQL, too.
333                 -sql
334                 attr_filter.access_reject
335
336                 #
337                 #  Let the outer session know which module failed, and why.
338                 #
339                 update outer.session-state {
340                         &Module-Failure-Message := &request:Module-Failure-Message
341                 }
342         }
343 }
344
345 #
346 #  When the server decides to proxy a request to a home server,
347 #  the proxied request is first passed through the pre-proxy
348 #  stage.  This stage can re-write the request, or decide to
349 #  cancel the proxy.
350 #
351 #  Only a few modules currently have this method.
352 #
353 pre-proxy {
354         #  Uncomment the following line if you want to change attributes
355         #  as defined in the preproxy_users file.
356 #       files
357
358         #  Uncomment the following line if you want to filter requests
359         #  sent to remote servers based on the rules defined in the
360         #  'attrs.pre-proxy' file.
361 #       attr_filter.pre-proxy
362
363         #  If you want to have a log of packets proxied to a home
364         #  server, un-comment the following line, and the
365         #  'detail pre_proxy_log' section, above.
366 #       pre_proxy_log
367 }
368
369 #
370 #  When the server receives a reply to a request it proxied
371 #  to a home server, the request may be massaged here, in the
372 #  post-proxy stage.
373 #
374 post-proxy {
375
376         #  If you want to have a log of replies from a home server,
377         #  un-comment the following line, and the 'detail post_proxy_log'
378         #  section, above.
379 #       post_proxy_log
380
381         #  Uncomment the following line if you want to filter replies from
382         #  remote proxies based on the rules defined in the 'attrs' file.
383 #       attr_filter.post-proxy
384
385         #
386         #  If you are proxying LEAP, you MUST configure the EAP
387         #  module, and you MUST list it here, in the post-proxy
388         #  stage.
389         #
390         #  You MUST also use the 'nostrip' option in the 'realm'
391         #  configuration.  Otherwise, the User-Name attribute
392         #  in the proxied request will not match the user name
393         #  hidden inside of the EAP packet, and the end server will
394         #  reject the EAP request.
395         #
396         eap
397 }
398
399 } # inner-tunnel server block