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