rlm_policy
FreeRADIUS Module
- Provided by: freeradius-common (Version: 2.1.12+dfsg-1.2ubuntu8.2)
- Source: freeradius
- Report a bug
FreeRADIUS Module
The rlm_policy module implements a simple "policy" language.
The policy language implemented by this module is simple, and specific to RADIUS. It does not implement variables, arrays, loops, goto's, or any other feature of a real language. If those features are needed for your system, we suggest using rlm_perl.
What the policy module implements is a simple way to look for attributes in the request packet (or other places), and to add attributes to the reply packet (or other places) based on those decisions. Where the module shines is that it is significantly more flexible than the old-style users file.
The module has one configuration item:
The policy is composed of a series of named policies. The following example defines a policy named "foo".
policy foo {
...
}
Policy names MAY NOT be the same as attributes in the dictionary. Defining a policy with the same name as a dictionary attribute will cause an error message to be printed, and the policy will not be loaded.
When the policy module is listed in a module section like "authorize", the module calls a policy named "authorize". The "post-auth", etc. sections behave the same. These names cannot be changed.
include "policy.txt"
The filename must be in a double-quoted string, and is assumed to be relative to the location of the current file. If the filename ends with a '/', then it is assumed to be a directory, and all files in that directory will be read.
include "dir/"
All file in "dir/" will be read and included into the policy definition. Any dot files (".", "..", etc.) will not be included, however.
The main file referred to from the radiusd.conf may include one or more other files, as in the following example.
The following example references a named policy
foo()
While the brackets are required, no arguments may be passed.
"if" statements are supported.
if (expression) {
...
}
and "else"
if (expression) {
...
} else {
...
}
also, "else if"
if (expression) {
...
} else if (expression) {
...
}
Always have to have brackets around them. Sorry.
The following kinds of expressions may be used, with their meanings.
Attribute references are:
reply .= {
attribute-name = value
...
attribute-name = value
}
The first name can be "request", "reply", "control", "proxy-request", or "proxy-reply".
The operator can be
.= - appends attributes to end of the list
:= - replaces existing list with the attributes in the list (bad idea)
= - use operators from "attribute = value" to decide what to do.
(see "users")
The block must contain only attributes and values. Nothing else is permitted.
authorize post-auth pre-proxy post-proxy
/etc/raddb/radiusd.conf
Alan DeKok <aland@ox.org>