Initial commits
[freeradius-pysaml2.git] / template / sites-available_inner-tunnel.dont_use
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 UNTIL IT WORKS.
29 #
30 #  Do NOT keep testing PEAP.  It won't help.
31 #
32 listen {
33        ipaddr = 127.0.0.1
34        port = 18120
35        type = auth
36 }
37
38
39 #  Authorization. First preprocess (hints and huntgroups files),
40 #  then realms, and finally look in the "users" file.
41 #
42 #  The order of the realm modules will determine the order that
43 #  we try to find a matching realm.
44 #
45 #  Make *sure* that 'preprocess' comes before any realm if you 
46 #  need to setup hints for the remote radius server
47 authorize {
48         #
49         #  The chap module will set 'Auth-Type := CHAP' if we are
50         #  handling a CHAP request and Auth-Type has not already been set
51         chap
52
53         #
54         #  If the users are logging in with an MS-CHAP-Challenge
55         #  attribute for authentication, the mschap module will find
56         #  the MS-CHAP-Challenge attribute, and add 'Auth-Type := MS-CHAP'
57         #  to the request, which will cause the server to then use
58         #  the mschap module for authentication.
59         mschap
60
61         #
62         #  Pull crypt'd passwords from /etc/passwd or /etc/shadow,
63         #  using the system API's to get the password.  If you want
64         #  to read /etc/passwd or /etc/shadow directly, see the
65         #  passwd module, above.
66         #
67 #       unix
68
69         #
70         #  Look for IPASS style 'realm/', and if not found, look for
71         #  '@realm', and decide whether or not to proxy, based on
72         #  that.
73 #       IPASS
74
75         #
76         #  If you are using multiple kinds of realms, you probably
77         #  want to set "ignore_null = yes" for all of them.
78         #  Otherwise, when the first style of realm doesn't match,
79         #  the other styles won't be checked.
80         #
81         #  Note that proxying the inner tunnel authentication means
82         #  that the user MAY use one identity in the outer session
83         #  (e.g. "anonymous", and a different one here
84         #  (e.g. "user@example.com").  The inner session will then be
85         #  proxied elsewhere for authentication.  If you are not
86         #  careful, this means that the user can cause you to forward
87         #  the authentication to another RADIUS server, and have the
88         #  accounting logs *not* sent to the other server.  This makes
89         #  it difficult to bill people for their network activity.
90         #
91         suffix
92 #       ntdomain
93
94         #
95         #  The "suffix" module takes care of stripping the domain
96         #  (e.g. "@example.com") from the User-Name attribute, and the
97         #  next few lines ensure that the request is not proxied.
98         #
99         #  If you want the inner tunnel request to be proxied, delete
100         #  the next few lines.
101         #
102         update control {
103                Proxy-To-Realm := LOCAL
104         }
105
106         #
107         #  This module takes care of EAP-MSCHAPv2 authentication.
108         #
109         #  It also sets the EAP-Type attribute in the request
110         #  attribute list to the EAP type from the packet.
111         #
112         #  The example below uses module failover to avoid querying all
113         #  of the following modules if the EAP module returns "ok".
114         #  Therefore, your LDAP and/or SQL servers will not be queried
115         #  for the many packets that go back and forth to set up TTLS
116         #  or PEAP.  The load on those servers will therefore be reduced.
117         #
118         eap {
119                 ok = return
120         }
121
122         #
123         #  Read the 'users' file
124         files
125
126         #
127         #  Look in an SQL database.  The schema of the database
128         #  is meant to mirror the "users" file.
129         #
130         #  See "Authorization Queries" in sql.conf
131 #       sql
132
133         #
134         #  If you are using /etc/smbpasswd, and are also doing
135         #  mschap authentication, the un-comment this line, and
136         #  configure the 'etc_smbpasswd' module, above.
137 #       etc_smbpasswd
138
139         #
140         #  The ldap module will set Auth-Type to LDAP if it has not
141         #  already been set
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         #
218         #  See 'man getpwent' for information on how the 'unix'
219         #  module checks the users password.  Note that packets
220         #  containing CHAP-Password attributes CANNOT be authenticated
221         #  against /etc/passwd!  See the FAQ for details.
222         #  
223         unix
224
225         # Uncomment it if you want to use ldap for authentication
226         #
227         # Note that this means "check plain-text password against
228         # the ldap database", which means that EAP won't work,
229         # as it does not supply a plain-text password.
230 #       Auth-Type LDAP {
231 #               ldap
232 #       }
233
234         #
235         #  Allow EAP authentication.
236         eap
237 }
238
239 ######################################################################
240 #
241 #       There are no accounting requests inside of EAP-TTLS or PEAP
242 #       tunnels.
243 #
244 ######################################################################
245
246
247 #  Session database, used for checking Simultaneous-Use. Either the radutmp 
248 #  or rlm_sql module can handle this.
249 #  The rlm_sql module is *much* faster
250 session {
251         radutmp
252
253         #
254         #  See "Simultaneous Use Checking Queries" in sql.conf
255 #       sql
256 }
257
258
259 #  Post-Authentication
260 #  Once we KNOW that the user has been authenticated, there are
261 #  additional steps we can take.
262 post-auth {
263         # Note that we do NOT assign IP addresses here.
264         # If you try to assign IP addresses for EAP authentication types,
265         # it WILL NOT WORK.  You MUST use DHCP.
266
267         #
268         #  If you want to have a log of authentication replies,
269         #  un-comment the following line, and the 'detail reply_log'
270         #  section, above.
271 #       reply_log
272
273         #
274         #  After authenticating the user, do another SQL query.
275         #
276         #  See "Authentication Logging Queries" in sql.conf
277 #       sql
278
279         #
280         #  Instead of sending the query to the SQL server,
281         #  write it into a log file.
282         #
283 #       sql_log
284
285         #
286         #  Un-comment the following if you have set
287         #  'edir_account_policy_check = yes' in the ldap module sub-section of
288         #  the 'modules' section.
289         #
290 #       ldap
291
292         # Use the Python module
293         python
294
295         #
296         #  Access-Reject packets are sent through the REJECT sub-section of the
297         #  post-auth section.
298         #
299         #  Add the ldap module name (or instance) if you have set 
300         #  'edir_account_policy_check = yes' in the ldap module configuration
301         #
302         Post-Auth-Type REJECT {
303                 # log failed authentications in SQL, too.
304 #               sql
305                 attr_filter.access_reject
306         }
307
308         #
309         #  The example policy below updates the outer tunnel reply
310         #  (usually Access-Accept) with the User-Name from the inner
311         #  tunnel User-Name.  Since this section is processed in the
312         #  context of the inner tunnel, "request" here means "inner
313         #  tunnel request", and "outer.reply" means "outer tunnel
314         #  reply attributes".
315         #
316         #  This example is most useful when the outer session contains
317         #  a User-Name of "anonymous@....", or a MAC address.  If it
318         #  is enabled, the NAS SHOULD use the inner tunnel User-Name
319         #  in subsequent accounting packets.  This makes it easier to
320         #  track user sessions, as they will all be based on the real
321         #  name, and not on "anonymous".
322         #
323         #  The problem with doing this is that it ALSO exposes the
324         #  real user name to any intermediate proxies.  People use
325         #  "anonymous" identifiers outside of the tunnel for a very
326         #  good reason: it gives them more privacy.  Setting the reply
327         #  to contain the real user name removes ALL privacy from
328         #  their session.
329         #
330         #  If you want privacy to remain, see the
331         #  Chargeable-User-Identity attribute from RFC 4372.  In order
332         #  to use that attribute, you will have to allocate a
333         #  per-session identifier for the user, and store it in a
334         #  long-term database (e.g. SQL).  You should also use that
335         #  attribute INSTEAD of the configuration below.
336         #
337         #update outer.reply {
338         #       User-Name = "%{request:User-Name}"
339         #}
340
341 }
342
343 #
344 #  When the server decides to proxy a request to a home server,
345 #  the proxied request is first passed through the pre-proxy
346 #  stage.  This stage can re-write the request, or decide to
347 #  cancel the proxy.
348 #
349 #  Only a few modules currently have this method.
350 #
351 pre-proxy {
352 #       attr_rewrite
353
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 #       attr_rewrite
382
383         #  Uncomment the following line if you want to filter replies from
384         #  remote proxies based on the rules defined in the 'attrs' file.
385 #       attr_filter.post-proxy
386
387         #
388         #  If you are proxying LEAP, you MUST configure the EAP
389         #  module, and you MUST list it here, in the post-proxy
390         #  stage.
391         #
392         #  You MUST also use the 'nostrip' option in the 'realm'
393         #  configuration.  Otherwise, the User-Name attribute
394         #  in the proxied request will not match the user name
395         #  hidden inside of the EAP packet, and the end server will
396         #  reject the EAP request.
397         #
398         eap
399
400         #
401         #  If the server tries to proxy a request and fails, then the
402         #  request is processed through the modules in this section.
403         #
404         #  The main use of this section is to permit robust proxying
405         #  of accounting packets.  The server can be configured to
406         #  proxy accounting packets as part of normal processing.
407         #  Then, if the home server goes down, accounting packets can
408         #  be logged to a local "detail" file, for processing with
409         #  radrelay.  When the home server comes back up, radrelay
410         #  will read the detail file, and send the packets to the
411         #  home server.
412         #
413         #  With this configuration, the server always responds to
414         #  Accounting-Requests from the NAS, but only writes
415         #  accounting packets to disk if the home server is down.
416         #
417 #       Post-Proxy-Type Fail {
418 #                       detail
419 #       }
420
421 }
422
423 } # inner-tunnel server block