Use now(), not now
[freeradius.git] / raddb / policy.conf
1 # -*- text -*-
2 ##
3 ## policy.conf  -- FreeRADIUS server configuration file.
4 ##
5 ##      http://www.freeradius.org/
6 ##      $Id$
7 ##
8
9 #
10 #  Policies are virtual modules, similar to those defined in the
11 #  "instantate" section of radiusd.conf.
12 #
13 #  Defining a policy here means that it can be referenced in multiple
14 #  places as a *name*, rather than as a series of conditions to match,
15 #  and actions to take.
16 #
17 #  Policies are something like subroutines in a normal language, but
18 #  they cannot be called recursively.  They MUST be defined in order.
19 #  If policy A calls policy B, then B MUST be defined before A.
20 #
21 policy {
22         #
23         #       Forbid all EAP types.
24         #
25         forbid_eap {
26                 if (EAP-Message) {
27                         reject
28                 }
29         }
30
31         #
32         #       Forbid all non-EAP types outside of an EAP tunnel.
33         #
34         permit_only_eap {
35                 if (!EAP-Message) {
36                         #  We MAY be inside of a TTLS tunnel.
37                         #  PEAP and EAP-FAST require EAP inside of
38                         #  the tunnel, so this check is OK.
39                         #  If so, then there MUST be an outer EAP message.
40                         if (!"%{outer.request:EAP-Message}") {
41                                 reject
42                         }
43                 }
44         }
45
46         #
47         #       Forbid all attempts to login via realms.
48         #
49         deny_realms {
50                 if (User-Name =~ /@|\\/) {
51                         reject
52                 }
53         }
54
55         #
56         #       If you want the server to pretend that it is dead,
57         #       then use the "do_not_respond" policy.
58         #
59         do_not_respond {
60                 update control {
61                         Response-Packet-Type := Do-Not-Respond
62                 }
63
64                 handled
65         }
66 }