Clean up loopback / inaddr_any checks
[freeradius.git] / man / man5 / rlm_attr_filter.5
1 .\"     # DS - begin display
2 .de DS
3 .RS
4 .nf
5 .sp
6 ..
7 .\"     # DE - end display
8 .de DE
9 .fi
10 .RE
11 .sp
12 ..
13 .TH rlm_attr_filter 5 "12 February 2008" "" "FreeRADIUS Module"
14 .SH NAME
15 rlm_attr_filter \- FreeRADIUS Module
16 .SH DESCRIPTION
17 The \fIrlm_attr_filter\fP module exists for filtering certain
18 attributes and values in received ( or transmitted ) radius packets.
19 It gives the server a flexible framework to filter the attributes we
20 send to or receive from home servers or NASes.  This makes sense, for
21 example, in an out-sourced dialup situation to various policy
22 decisions, such as restricting a client to certain ranges of
23 Idle-Timeout or Session-Timeout.
24 .PP
25 Filter rules are normally defined and applied on a per-realm basis,
26 where the realm is anything that is defined and matched based on the
27 configuration of the \fIrlm_realm\fP module.  Filter rules can
28 optionally be applied using another attribute, by editing the
29 \fIkey\fP configuration for this module.
30 .PP
31 In 2.0.1 and earlier versions, the "accounting" section filtered the
32 Accounting-Request, even though it was documented as filtering the
33 response.  This issue has been fixed in version 2.0.2 and later
34 versions.  The "preacct" section may now be used to filter
35 Accounting-Request packets.  The "accounting" section now filters
36 Accounting-Response packets.  Administrators using "attr_filter" in
37 the "accounting" section SHOULD move the reference to "attr_filter"
38 from "accounting" to "preacct".
39 .PP
40 The file that defines the attribute filtering rules follows a similar
41 syntax to the \fIusers\fP file.  There are a few differences however:
42 .PP
43 .DS
44     There are no check-items allowed other than the name of the key.
45 .PP
46     There can only be a single DEFAULT entry.
47 .PP
48 The rules for each entry are parsed to top to bottom, and an
49 attribute must pass *all* the rules which affect it in order to
50 make it past the filter.  Order of the rules is important.
51 The operators and their purpose in defining the rules are as
52 follows:
53 .TP
54 .B =   
55 THIS OPERATOR IS NOT ALLOWED.  If used, and warning message is
56 printed and it is treated as ==
57 .TP
58 .B :=  
59 Set, this attribute and value will always be placed in the
60 output A/V Pairs.  If the attribute exists, it is overwritten.
61 .TP
62 .B  ==  
63 Equal, value must match exactly.
64 .TP
65 .B  =*  
66 Always Equal, allow all values for the specified attribute.
67 .TP
68 .B    !*  
69 Never Equal, disallow all values for the specified attribute.
70 ( This is redundant, as any A/V Pair not explicitly permitted
71 will be dropped ).
72 .TP
73 .B    !=  
74 Not Equal, value must not match.
75 .TP
76 .B    >=  
77 Greater Than or Equal
78 .TP
79 .B    <=  
80 Less Than or Equal
81 .TP
82 .B    >   
83 Greater Than
84 .TP
85 .B    <   
86 Less Than
87 .PP
88 If regular expressions are enabled the following operators are
89 also possible.  ( Regular Expressions are included by default
90 unless your system doesn't support them, which should be rare ).
91 The value field uses standard regular expression syntax.
92 .PP
93 .TP
94 .B    =~  
95 Regular Expression Equal
96 .TP
97 .B    !~  
98 Regular Expression Not Equal
99 .PP
100 See the default \fI/etc/raddb/attrs\fP for working examples of
101 sample rule ordering and how to use the different operators.
102 .DE
103 .PP
104 The configuration items are:
105 .IP attrsfile
106 This specifies the location of the file used to load the filter rules.
107 This file is used to filter the accounting response, packet before it
108 is proxied, proxy response from the home server, or our response to
109 the NAS.
110 .IP key
111 Usually %{Realm} (the default).  Can also be %{User-Name}, or other
112 attribute that exists in the request.  Note that the module always
113 keys off of attributes in the request, and NOT in any other packet.
114 .PP
115 .SH SECTIONS
116 .IP preacct
117 Filters Accounting-Request packets.
118 .IP accounting
119 Filters Accounting-Response packets.
120 .IP pre-proxy
121 Filters Accounting-Request or Access-Request packets prior to proxying
122 them.
123 .IP post-proxy
124 Filters Accounting-Response, Access-Accept, Access-Reject, or
125 Access-Challenge responses from a home server.
126 .IP authorize
127 Filters Access-Request packets.
128 .IP post-auth
129 Filters Access-Accept or Access-Reject packets.
130 .PP
131 .SH FILES
132 .I /etc/raddb/radiusd.conf
133 .I /etc/raddb/attrs
134 .PP
135 .SH "SEE ALSO"
136 .BR radiusd (8),
137 .BR radiusd.conf (5)
138 .SH AUTHOR
139 Chris Parker, cparker@segv.org
140